Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not enough storage is available to complete this operation - Program or Storage memory?

I've been given a Windows Mobile app written in .Net CF 3.5 to fix, and one of the problems is to do with storage.

The message 'Not enough storage is available to complete this operation' has appeared a few times - it's logged in the SQL CE database, and always happens during data access (but not the same bit of data access).

The thing I'm slightly confused about is whether this refers to Program Memory (e.g. RAM) or Storage Memory (e..g permanent storage). It would appear to be storage memory, but the devices seem to have plenty free. While there are some OutOfMemoryExceptions, these appear totally unrelated to this problem (in that that happen at a different time due to an image-related issue).

We're using SQL CE 3.5 with a single connection, which is stored along with the app on the device (as opposed to the storage card). The device is a Motorola MC75 running Windows Mobile 6.1.

Any thoughts?

like image 585
Grant Crofton Avatar asked May 21 '10 10:05

Grant Crofton


People also ask

How do I fix not enough memory resources are available to complete this operation?

Not enough memory available to complete this operation. Quit one or more applications to increase available memory, and then try again. Note This problem only occurs when the amount of available physical memory is more than 2 GB. See the "More Information" section for information about how to determine this value.

Why does my computer say there is not enough disk space when there is?

When your computer says that there is not enough disk space, it means that your hard drive is almost full and you are unable to save large files to this drive. To fix the hard drive full issue, you can uninstall some programs, add a new hard drive or replace the drive with a larger one.


1 Answers

It is a low-level Windows error, code 14, ERROR_OUTOFMEMORY. The error message doesn't mention "memory" because it isn't always caused by running out of memory. The most typical trigger is a program exceeding its quota of kernel resources. Like 10,000 window handles, there are many others. That's for the desktop edition btw, I don't doubt it is much lower on Windows Mobile.

Well, the program is a piggy. One possible way to trigger this error is to not call Dispose() on objects of classes that implement IDisposable. That will consume kernel resources that won't be released until the garbage collector and finalizer thread run. Which could take a while. The SQL CE classes are certainly a candidate. If you have no clue where the resource leak or over-usage is coming from then invest in a profiler that works on CF.

like image 136
Hans Passant Avatar answered Nov 15 '22 06:11

Hans Passant