01-14-2007 07:27 AM
01-14-2007 08:11 AM
Its expected behaviour in your implementation. You keep appending the image which means the picture continues to grow. Thats why you have a memory leak.
David
01-14-2007 08:58 AM - edited 01-14-2007 08:58 AM
I believe David properly called the cause of this memory consumption.
In reply # 52 of thsi thread,
http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=5&jump=true
I posted an example that inserts 130 FP object images in a picture and moves them around (it is a random walk where each object is assigned a letter and the program terminates when all of the letters required to spell out "Hello World" wander into the trap at the bottom.)
A snippet of the code follows.
A) Start with a blank picture
B) Inster all of the images
C) show the updated image.
Other links to LV Picture control examples can be found in this thread.
http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=14&jump=true
Ben
Message Edited by Ben on 01-14-2007 08:58 AM
01-14-2007 02:19 PM
@nadav Chernin wrote:
Can somebody to prevent this bug?
Just replace the shift register with a plain tunnel and place the "get image" node inside the loop. 🙂 (This is the solution if the string might change during run and you want to see the current image.)
.... Of course since the "get image" node is currently outside the loop, it will run exactly once and nothing will ever change inside the loop. You might as well delete the loop entirely. Right?
01-15-2007 04:21 AM
Hi, David
I don't think that i just append new picture to old picture as to concatinate 2 strings. I think that LV implement it as replace area of old picture by new picture.
Look attached example that continue to append picture but memory don't leak
01-15-2007 04:29 AM - edited 01-15-2007 04:29 AM
Message Edited by rolfk on 01-15-2007 11:32 AM
01-15-2007 04:41 AM - edited 01-15-2007 04:41 AM
If you need to be convinced then take a look inside the Draw Flattened Pixmap.
David
Message Edited by David Crawford on 01-15-2007 10:42 AM
01-15-2007 07:43 AM
Nadav,
Inside your loop (of your original example) branch the wire coming for the shift-register to a "flatten to string" then get the sring length returned and display it on your FP.
You will see that the amount of data in the SR grows with each interation.
Ben