pixijs / node

Run PixiJS but in Node.js environments, no browser required!
https://pixijs.com
MIT License
36 stars 7 forks source link

Memory leak while running in Docker with xvfb #7

Open romanzipp opened 1 year ago

romanzipp commented 1 year ago

I'm running PixiJS node in a Docker container, based on the example Dockerfile via xvfb.

My app provides a HTTP endpoint which simply generates an image. After every request I'm unloading all assets from the Asset & Cache manager.

Might not be the prettiest way but it works.

Assets.unload(
    Array.from(
        Assets.cache._cacheMap.keys(),
    ),
);

I also tried calling the destroy() method on all generated display objects.

The pixi app instance also gets re-used and won't be destroyed between requests.

When running the app locally on macOS the memory usage stays constant - no matter how many requests I throw at it. Running it in the Docker container results in the memory footprint growing constantly with every request. Looking at the process monitor indicates that this is an issue with node - not xvfb.

This issue is also not caused due to dev/prod builds, both ways lead to a memory leak.

I'll try sharing a sample app - but until then I'll try my best here if anyone has advice on this.

iqbaljunaid commented 9 months ago

https://bugzilla.redhat.com/show_bug.cgi?id=498357

iqbaljunaid commented 9 months ago

https://unix.stackexchange.com/questions/25412/xvfb-does-not-release-memory