05-16-2011 03:04 AM
Hi,
I've developed quite a large bit of software. One of the software modules runs on a RT Gateway. I usually let the code run for a few days to test it. Although twice now it it has crashed after about a day and in MAX I see the RT device is in Safe mode (software error). If I view the error log under Labview sessions I have this in both instances...
05/10/11 08:47:24.251 AM
source/MemoryManager.cpp(146) : DWarnInternal: Memory error 2 in DSSetHSzClr
05/10/11 08:47:24.253 AM
source/exec/CleanupProc.cpp(269) : DWarn: can't realloc cleanup tbl
I can only guess that somewhere I have a memory leak or some common memory problem, but I have struggled to find it. I also have not seen this error before. I'm hoping someone has more insight into this particular error.
Thanks in advance
05-17-2011 02:46 PM
You're right that this error means that you've ran out of memory. If you look at the following link it says that Error 2 means Memory Full.
http://zone.ni.com/reference/en-XX/help/371361G-01/lvexcode/azsethszclr_dssethszclr/
As to how to track down a memory leak, if you run the VI in LabVIEW, you can take a look at the performance profile to see if there truly is a leak. To do this you can go to Tools >> Profile >> Performance and Memory.... Keep an eye on those numbers and see if they grow over time. If they do, you may have to take a look at your code in small chunks and see which chunk still has a memory leak.