Adding metadata takes up ram

Hey,
So i’ve been working on a agent which downloads metadata in a zip file to memory and then processes it and then add it to the metadata.

Here’s the relevant code http://pastebin.com/DQ4yL8Cu in the update function

The issue is that i have a ton of fanart pics, and when i iterate through the entire zip file and add them it works, but the memory used by my plug-in begins to increase everytime i run it.

I have narrowed the issue to the the statement that adds the metadata,
metadata.posters[pics]=Proxy.Media(zip_archive[pics], sort_order = pcount)
metadata.art[pics]=Proxy.Media(zip_archive[pics], sort_order = acount)

If I leave everything as is and just comment out those lines the memory issue is gone.

Can anyone here help me?

Thanks,

@sander1 can you help me out here? still having the issue

I would think you would have better luck finding developers who are familiar with and could help by posting in the Scanner and Metadata Agent Development section of the forum since this is an issue with an agent plugin and not a channel plugin.