LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

About the labview call MemoryStream memory increase

I in the BBS of continuous running VI will lead to increased memory, increase the dispose doesn't work, is there a good way to everybody, thank you超内存.PNG

0 Kudos
Message 1 of 5
(1,123 Views)

What does "BBS" mean?

The rest of the sentence doesn't make any sense in English.  I suppose it is a poor translation from your native language.

 

 

What are you really trying to do here?

Why do you need to use a memory stream?

 

When you have a constructor inside the loop, then you are "constructing" a new object every iteration.  So it makes perfect sense why you'd have an increase in memory as the program runs.

0 Kudos
Message 2 of 5
(1,062 Views)

@RavensFan wrote:

What does "BBS" mean?

The rest of the sentence doesn't make any sense in English.  I suppose it is a poor translation from your native language.

 

 

What are you really trying to do here?

Why do you need to use a memory stream?

 

When you have a constructor inside the loop, then you are "constructing" a new object every iteration.  So it makes perfect sense why you'd have an increase in memory as the program runs.


I think memory streams are used to write a bitmap to a picturebox, or whatever .NET calls it.  It's been a while since I've thought about .NET, but I believe You have to be very careful to close references and stuff, especially when it comes to memory streams and pictureboxes, or you rapidly run out of memory.  I learned the hard way when programming my video game.  Because it was updating a fairly large picturebox at a frantic pace, it chewed through 32GB of memory before I could hit the abort button!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(1,043 Views)

Yes, close the references:

Close References.PNG

 

This does not close the Stream, nor the Image! It closes the reference to the Stream, and the reference to the Image. If (when) there are no more references to the Stream or Image, the object is removed from memory. 

Message 4 of 5
(1,006 Views)

BTW. Any reason you want to use a .NET control?

0 Kudos
Message 5 of 5
(1,002 Views)