-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory not freed when free_after_load is True #246
Comments
@jean-emmanuel I will have a look at this in an hour or two.. it does look odd, perhaps the highly optimised C and Fortran code in numpy skips some registration process, or the copying of the bytes is optimised into a transfer of ownership in some way? |
Running the same test on a system with an integrated graphic card (and shared video memory) gave different results (same pi3d/numpy version):
|
Yes it's very odd. Showing the memory with
when it's building the list then the memory stops being consumed although new Texture objects are being created. Similarly if the I might do some more experiments and get info from gc |
Hmm, from what I understand memory management in opengl is hardware/driver dependent and nvidia driver may well keep memory allocated in ram as well as in vram (for swapping I guess). It may not be an issue with other hardwares (it isn't with that aforementioned intel integrated graphic card). |
Running the script with a system ram consumption limit made it a lot slower but eventually all the textures got into the vram while ram usage stood under the limit (which was 4x lower than the total allocated vram), this could well corroborate the nvidia-swap theory. |
Hi,
I'm having some trouble finding the source of this issue. I'm using pi3d on a linux desktop and I've been able to manage the video memory consumption well : the gpu memory is freed as expected when dereferencing the textures; however, I can't manage to free the RAM where the texture is stored as a numpy array, even when setting the
free_after_load
flag. Here is a minimal reproduction script, I'm monitoring the actual memory consumption with these two commands:free -h
(ram)glxinfo |grep "available.*memory"
(vram)Besides the
tex.file_string
reference I didn't find any living reference to the texture's array that would prevent garbage collection... any thoughts ?The text was updated successfully, but these errors were encountered: