LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI crash before InitCVIRTE in debugging mode

I'm experiencing a CVI 7.1 crash with code that was working. When I run in debug mode the CVI window will vanish, or a popup will appear with an Out of Memory message.

The crash occurs before the code gets to the InitCVIRTE command at the beginning of main.

If I build a stand-alone executable from the same code, the programs runs correctly.

I'd really like to be able to use the debugging environment.

Any advice?

Dick Kirk
PXIT Inc
0 Kudos
Message 1 of 7
(4,175 Views)

Hi Dick,

I never been faced to a similar problem, and I don't know the size of your code.

However debbugable executable can require additional memory to run (i.e to detect uninitialized variables), and this can explain why your code runs in release and not in debuggable. Try to increase the stack memory size on the "Build Options" menu.

 

Bye

baloss

0 Kudos
Message 2 of 7
(4,158 Views)
Hello DickKirk,

You can also try changing the debugging level of your application to No Run-Time Checking from the Build Options menu.  In this mode, you can set breakpoints and use the Variables window. You have no protection from run-time memory errors, and you cannot use the Run»Break on»Library Errors option.  This option reduces the amount of debugging information CVI holds for your application, and thus, frees up memory.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 3 of 7
(4,140 Views)
Thanks for the input. I updated CVI/LabWindows to version 7.1.1.
I had several runs where the debug version was able to run.
So I thought that the 7.1.1 fix might have solved it.
But then the "Out of memory" condition happed again.

I disabled the RunTime checking as Wendy suggested.

I still get the Out of Memory condition, but not consistently. A re-boot of the PC sometimes helps to get it running.
Sometimes just a second attempt to run the program succeeds.

I have added memory to the PC up to the maimum (512 M) for this old PC. Naturally, Windows grabbed a lot of the new memory for itself.

Is there a recommended memory size for LabWindows/CVI?

Should I consider getting a new PC with 1G or more memory?

I'm beginning to suspect that CVI is inadvertently using some memory that Windows considers to be its own.
Will additional memory help?


Dick Kirk
0 Kudos
Message 4 of 7
(4,094 Views)
I am not sure what your application is doing, but unless you are consuming huge amounts of dynamic memory or pushing really large structures on the stack within your application, 512M should be more than enough to run correctly.  You might want to look at the task manager to see if it is the CVI application or some other program on the PC that is chewing up resources.  If it is the CVI application, then the hunt for a memory leak can be started.
0 Kudos
Message 5 of 7
(4,088 Views)
Ok. I'll try freeing up all the dynamically allocated memory.

Dick
0 Kudos
Message 6 of 7
(4,086 Views)
The issue really wasn't if you free it, but how much you allocated.  If you have some really large data structures you try and allocate memory for, or that are in a static data segment, then yes you can run out of memory.  Since you program was originally at InitCVIRTE, it may be the data segment itself.  Do you have a really large data structure you are using?  Some huge array of structures or strings maybe?
0 Kudos
Message 7 of 7
(4,080 Views)