LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not enough memory to complete this operation.

Solved!
Go to solution

I've had a look through the postings under this subject with no solution to the error i am experiencing.

 

My LabVIEW application executes on a Window 7 PC and receives TCP/IP messages from a LabVIEW application executing on tha RT PC.  These messages range from 4 kbytes to 7k bytes in length and when received are queued in the TCP/IP comms thread and dequeued and converted into the correct data type for display on the front panel in another thread (producer/consumer design).

 

After executing for between 1 and 24 hours one or more "Not enough memory to complete this operation." dialogs are displayed.  This halts the execution of the app but closing these dialogs allows the app to continue executing.  What i find strange is that if there is not enough memory available how is it possible for the app to continue executing. Viewing the Resource Monitor under Windows shows that there is still 1.1GB available.  What is also strange is that there in no noticable change in the memory committed to my app.  I would expect that if i had a memory leak that the memory committed would slowly creep up. Could it be that i require additional RAM in this PC or will adding RAM just increase the time between errors? 

 

The specs of my system are as follows:

 

Dell Optiplex XE Intel Core 2 Duo CPU 3GHz/ RAM 2GB running Windows 7 Professional 32-bit

LabVIEW 2010 SP1

 

Any help with is would be appreciated.

Regards,

Rob

 

 

 

0 Kudos
Message 1 of 19
(44,998 Views)
Solution
Accepted by Robert_North

Dear Rob,

 

Same problem I was facing in one of my applications.

Give some delay in your RT TCP write loop. RAM is fine no issue with your RAM. If you log your data file you found after some time you get some junk characters on TCP/IP these junk characters increase your data to read size. So to avoid this give some delay in your cRIO TCP send loop.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 19
(44,990 Views)

The error you are seeing is probably coming from the OS. It is a little decieving as it is really refering the memory that is allocated for thread processing. Use Task manager to monitor your thread count at start up and throughout the day see if it increases over time. I would also monitor the handle counts as well.

 

Unlike Win XP and older OS's which limited the number of active threads for a running process to 2024, Windows 2003 and higher only limit the number based on the availavble resource, It is possible that threads are not being closed as fast as they are spawned and therefor you will see this limit hit. Check you system and Application event logs to see if there are evenbt messages posted there. Lastly make sure you do not have applications launching at those times that do a burst consumption of ram.

Fred Loveless
Kepware Technologies
http://www.kepware.com
Message 3 of 19
(44,982 Views)

One additional tip:

a wait primitive with a 0 ms delay is quite useful in these situations. It forces the executing thread to release allowing Windows to jump in and do garbage collection .  Dealocation of memory associated with references that are closed depends on the OS garbage collection (even when you request dealocation of memory.)  The clumping algorithm optimizes performance by surprising thread switches whenever possible so, this leaves Windows garbage collection out in the cold- unless you invite it in by releasing the current thread.

 

So when the out of memory exception is thrown- your executing threads are halted- and garbage is dumped freeing the memory that you ran out of and you observe- Out of memory errors that fix themselves and show plenty of memory available- so the app will chug along after you acknowledge the prompt.


"Should be" isn't "Is" -Jay
Message 4 of 19
(44,971 Views)

Hi Himanshu,

 

My application has been running now for 17 hours after tring your suggestion.  I'll run it over the next few days and will let you know how it goes.

 

Thanks for the help.

Much appreciated.

Rob 

0 Kudos
Message 5 of 19
(44,936 Views)

Hi Himanshu,

 

My application has been running now for 17 hours after tring your suggestion.  I'll run it over the next few days and will let you know how it goes.

 

Thanks for the help.

Much appreciated.

Rob 

0 Kudos
Message 6 of 19
(44,936 Views)

I am getting the error not enough memory to complete this operation as described by others here; and if I just close the message popup as soon as it appears the execution will continue running fine.  There are no apparent memory issues when viewing task manager.  My test sequence is doing parallel testing on 48 UUTs by creation of multiple executions running in parallel.  I will get about 15 of these popups during my 30 minute execution, so it is rather annoying.  I tried to use a Wait (0s) as suggested but it did not have any affect.  I tried putting the wait in the following places:

 

1.  At the start of newly created executions

2.  At the end of above executions

3.  Just prior to the test step that has the "Use New Execution" Execution Option.

 

Any suggestions would be appreciated.

0 Kudos
Message 7 of 19
(44,255 Views)

Hi George,

 

Are you also using TCP/IP communication in your application?  If so, have you tried putting the wait in the TCP send loop as suggested?

Jayme W.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 19
(44,223 Views)

No, I am not using TCP/IP communication in my application.

 

Thanks,

George

0 Kudos
Message 9 of 19
(44,220 Views)

Hello,

 

Can you please elaborate more on what are you using? 

 

Have a good day!

0 Kudos
Message 10 of 19
(44,188 Views)