node-openvg-canvas
node-openvg-canvas copied to clipboard
Memory waste on image canvas
Dear Luis, I am using your library Node-OpenVG-Canvas . When loading images in sequential order, so the canvas image source function causes the free memory begins to decrease and it is not released ...
Try through the methods of .vgDestroy but while the image is deleted, the memory allocated to it is not released ...
Is there another way to release it ?
Thank you,
(Sorry for my bad english)
Hello. Not a software problem I think. The small memory of rpi is the cause. I've solved using: global.gc(); You need to add the parameter: --expose-gc Like: node-canvas --expose-gc examples/swissClock.js
Do not know if it's the best solution, but I have solved my problem. (Sorry for my bad english too)
Thank you very much for the reply. You're right in that little memory of raspberry is a problem, but there comes a part of this challenge ... I've done several tests and find that when creating image objects , loading the source , then to destroy the object or load another image, the memory is still used or consumed by the resource without being released by this resource. Anyway I will continue doing tests and we stay in touch .
You done a very good job with this library to work with the raspberry !
regards
Hi @4inn, thank you for the kind words and sorry for taking so long to get back. I can't at this time investigate much more on this issue.
If you are calling vgDestroy, the image buffer on the GPU should be getting released. Otherwise it seems that you may have some kind of memory leak.
Can you post some minimum code where you see this happening ?