Default Library Memory Usage Issue

Hi. I’ve noticed that when using the default library with a decent amount of data produces a huge memory usage spike during startup.

Repro steps:
With the “Pirate Pig” sample, add library directive (any of deflate, pak would produce the same result)

<library name="default" type="deflate"/>

Add some dummy images worth of 10Mb in the Assets/images folder. For this test, default.pak ended up at 9.2Mb.

In Chrome dev tools, memory tab, notice that immediately after loading, the memory used is over 400Mb, as seen in the attached screenshot. Clicking the collect garbage button or waiting for a while will reduce the used memory to 16-20Mb.

It would be very useful if unpacking the library would require less memory during startup, especially when running HTML5 content on devices with 512Mb of memory (e.g. Ipad mini).

Thanks for looking into this.

Is this specific to using a packed asset library, or is there a similar spike with an ordinary asset library? Thanks :slight_smile:

by ordinary asset library, you mean a pak? or simply not using the library directive?

with library type=“pak” it has a spike. not using a library directive, i don’t see any noticeable spike.

Okay, thanks! Helps to know it’s specific to packed asset libraries like this. We’ll look into it