Memory consumption of packp3d

Bug #1609882 reported by Yaio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Undecided
rdb

Bug Description

packp3d consumes a lot of memory: it seems that it doesn't unload models and textures from the memory. Observed with Panda3D 1.9.2, Ubuntu Trusty.

Yaio (yaio79)
description: updated
description: updated
Revision history for this message
rdb (rdb) wrote :

I'm having trouble reproducing this. Could you send a test case? How much memory is "a lot of memory"?

Otherwise, perhaps you could try setting "preload-textures false" in ~/.panda3d/prc/config.prc or set using loadPrcFileData at the top of your .pdef file. This will cause Panda to only read the headers of textures referenced by models, rather than loading the whole image into memory.

Revision history for this message
Yaio (yaio79) wrote :

Sure! As instance, I can't build the application in the following example with 1.2 GB of memory (in the example I use the ulimit command to emulate it; it works with more memory i.e. the p3d file is built as expected without the ulimit command):

wget https://github.com/cflavio/yorg/archive/master.zip
unzip master.zip
cd yorg-master
touch ya2/thirdparty/__init__.py
ulimit -Sv 1200000
packp3d -r bullet -r morepy -r models -r openal -o memoryissue.p3d

I receive the following output:

$ packp3d -r bullet -r morepy -r models -r openal -o memoryissue.p3d
:AppRunner: Total Panda3D disk space used: 154 MB
:AppRunner: Configured max usage is: 2048 MB
[...]
:gobj: Loading texture /home/flavio/Desktop/yorg-master/assets/models/tracks/track_prototype/tex/TEXSfondo.jpg
Out of memory allocating 100663296 bytes

Thank you!

Revision history for this message
rdb (rdb) wrote :

Thank you for the test case! I am pushing a change that reduces memory consumption to ~700 MB by no longer preloading textures. You can get the same effect by setting "preload-textures false" prc variable in your .pdef file or in ~/.panda3d/prc/config.prc .

Changed in panda3d:
assignee: nobody → rdb (rdb)
status: New → Fix Committed
milestone: none → 1.9.3
Revision history for this message
rdb (rdb) wrote :

Updated packp3d and ppackage on runtime.panda3d.org.

I do want to point out that if your textures were power-of-2, this would probably improve the performance and memory usage of packp3d.

Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.