# Adding metadata takes up ram

**URL:** <https://forums.plex.tv/t/adding-metadata-takes-up-ram/168294>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [November 24, 2016, 5:01pm UTC](https://forums.plex.tv/t/adding-metadata-takes-up-ram/168294 "2016-11-24T17:01:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brenden\_Carvalho](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/brenden_carvalho/32/83392_2.png) [@Brenden\_Carvalho](https://forums.plex.tv/u/Brenden_Carvalho)\
**Post date:** [November 24, 2016, 5:01pm UTC](https://forums.plex.tv/t/adding-metadata-takes-up-ram/168294/1 "2016-11-24T17:01:15Z")

</div>

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](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,

---

<div class="post-metadata">

**Author:** ![Brenden\_Carvalho](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/brenden_carvalho/32/83392_2.png) [@Brenden\_Carvalho](https://forums.plex.tv/u/Brenden_Carvalho)\
**Post date:** [November 29, 2016, 7:17am UTC](https://forums.plex.tv/t/adding-metadata-takes-up-ram/168294/2 "2016-11-29T07:17:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shopgirl284](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shopgirl284](https://forums.plex.tv/u/shopgirl284)\
**Post date:** [December 1, 2016, 11:12pm UTC](https://forums.plex.tv/t/adding-metadata-takes-up-ram/168294/3 "2016-12-01T23:12:13Z")

</div>

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](https://forums.plex.tv/categories/scanners-and-agents "Scanner and Metadata Agent Development section of the forum") since this is an issue with an agent plugin and not a channel plugin.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 8:00pm UTC](https://forums.plex.tv/t/adding-metadata-takes-up-ram/168294/4 "2020-01-08T20:00:28Z")

</div>


