node-openvg-canvas icon indicating copy to clipboard operation
node-openvg-canvas copied to clipboard

Memory waste on image canvas

Open 4inn opened this issue 11 years ago • 3 comments

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)

4inn avatar Nov 07 '14 02:11 4inn

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)

T4d3o avatar Nov 15 '14 18:11 T4d3o

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

4inn avatar Nov 16 '14 15:11 4inn

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 ?

eendeego avatar Nov 17 '14 03:11 eendeego