LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI8.5 crashes with Failure "Out of memory" after compiling

Solved!
Go to solution

Hello,

I used CVI 8.5 to compile my project in debug mode.

Before the last my last short changes i could run the project without any problem.

Now after beeing ready with compiling nothing happens for a while, then cvi crashes and a message "Out of memory" is shown, sometimes a message "A custom control callback raised an exception" appears.

I noticed that in the moment just before the out of memory message cames the windows virual memory used size suddenly goes up to 2.86 GB.

The pc has got 2 GB of physical memory and 6 GB of virtual memory, from both is free memory available.

If I change the debugging level to none, the software runs normaly, so I think there is no failure in code.

 

What is the problem ?

 

0 Kudos
Message 1 of 5
(4,316 Views)

Hi, Thorsten

Have you already tried to compile and debug a simple standard example from the NI example finder?
Can you verify the same behavior there?
If you have already problems with standard examples, I advise you to reinstall the CVI IDE.
Otherwise, start to uncomment parts of your code or whole modules (.c files), to locate the problem.
Unfortunately, your only using CVI 8.5.
In CVI 9.0 we released a new feature, to detect memory leaks, which could be very useful for those problems. Follow the attached link:
Memory Leak Detection with LabWindows/CVI

Hope this helps.
Ulrich
AE NICER

0 Kudos
Message 2 of 5
(4,251 Views)

Hi Ulrich,

thank you for your reply.

 

>Have you already tried to compile and debug a simple standard example from the NI example finder?
>Can you verify the same behavior there?
>If you have already problems with standard examples, I advise you to reinstall the CVI IDE.

Other projects and the cvi examples are running fine.

It seemed to be a compiler problem, which occured after my last changes.

If I go back to a further version of my code or if I use CVI 9.0 everything works fine.

 

>Otherwise, start to uncomment parts of your code or whole modules (.c files), to locate the problem.

I tried disabling functions but it made no sense for me, that it run's without a function and not with it.

After adding new functions to the code, the project now run's without any other change to the previous code. 


>Unfortunately, your only using CVI 8.5.
>In CVI 9.0 we released a new feature, to detect memory leaks, which could be very useful for those problems. Follow the attached link:
>Memory Leak Detection with LabWindows/CVI

The problem was that cvi 8.5 hangs/crashes after having compiled every file and before the program is running (linking-process ?).

I think it would not help to look at the resources of my program.

Because of the fact, that the code run's under CVI 9.0 and now with additional code also under CVI 8.5, I think that my code is not the problem.

 

Is there any possibilty to cause CVI to create a log-file of the build-process ?

0 Kudos
Message 3 of 5
(4,236 Views)

Your comment about a possible link problem reminded me of a similar issue described in a previous thread here, where (in reply #14) LuisG found an obscure linker problem. You could try his simple solutions, just to see if your problem is related.

 

JR

0 Kudos
Message 4 of 5
(4,228 Views)
Solution
Accepted by Torsten.Marx

Hello JR,

thank you for your post, you are totally right !

After I added some functions the problem was gone.

The failure seemed to be corrected in CVI 9.0, because the project worked without adding functions.

I searched with different keyword's in the forum, but I didn't find this reply.

Perhaps the problem in finding was that the theme of the threat has nothing to do with to my problem.

Thanks

       Torsten 

 

Solution from upper Link (other Thread) as Information to others: 

================================================================================================================================================================

Posted by LuisG, Proven Active Veteran, 11-19-2008 06:33 PM

Hi Trevor,

Thanks for submitting your test program. I've been able to reproduce the "out of memory" you've been seeing and so I've been investigating that problem first. I'll try to tackle the DAQ/timer problem tomorrow.

 

I did confirm that this is a bug in CVI that was previously unknown -- and that has been around for a very long time, undetected. The conditions that cause this bug to manifest itself are extremely rare, but you were nevertheless "lucky" enough to replicate them. Fortunately, there's a fairly easy workaround that you can do that should make those circumstances go away.

 

The problem happens when at a particular point during the link phase, an internal memory allocation is requested for a list of imported symbols, if the size of the list is between 8187 and 8189 symbols. In the case of your project, it happened to be 8188. This list consists of all the symbols that your project defines and also imports from all the libraries (including the CVI libraries) associated with the project. It just so happened that when you added the new source file, the total came to be 8188. This was completely dependent on what is in your project, of course, but also on the specific version of CVI that you're using.

 

One workaround consists of adding some gratuitous functions to your source file such that the total number of symbols will change. For example, I added the following code to myAsyncTimer.c, which was sufficient to no longer trigger the bug:

 

void foo (void)
{
}
void foo1 (void)
{
}
void foo2 (void)
{
}
void foo3 (void)
{
}
void foo4 (void)
{
}
void foo5 (void)
{
}
 

I'm sorry again for the double inconvenience. I'll look at the other problem next, and I'll let you know when I have some more information.

Luis

================================================================================================================================================================

0 Kudos
Message 5 of 5
(4,216 Views)