Not enough memory to complete this operation - program memory or memory?

I was offered a Windows Mobile application written in .Net CF 3.5, and one of the problems is storage.

The message "Insufficient memory is available to complete this operation" appeared several times - it was registered in the SQL CE database and always occurs during data access (but not to the same data access bit).

What I'm a bit confused about is whether this relates to program memory (e.g. RAM) or storage device (e..g persistent storage). It would seem that this is memory, but the devices seem to have a lot of free space. Although there are some OutOfMemoryExceptions, they seem completely unrelated to this problem (in that this happens at another time due to an image problem).

We use SQL CE 3.5 with one connection, which is saved with the application on the device (as opposed to a memory card). This is a Motorola MC75 device running Windows Mobile 6.1.

Any thoughts?

+4
source share
3 answers

This is a low-level Windows error code 14, ERROR_OUTOFMEMORY. The error message does not mention "memory" because it is not always caused by a lack of memory. The most typical trigger is a program that exceeds its kernel resource quota. Like 10,000 window handles, there are many others. For the desktop version of btw, I have no doubt that it is much lower on Windows Mobile.

Well, the program is a pig. One possible way to raise this error is to not call Dispose () on class objects that implement IDisposable. This will require kernel resources that will not be released until the garbage stream and finalizer stream are started. It can take some time. The SQL CE classes are certainly candidates. If you have no clue where the leak or overuse of resources comes from, invest in a CF profiler.

+8
source

How much virtual memory is allocated? Increase the value if possible.

0
source

I don’t know if this also applies to the MC75, but on Start->Settings->Control Panel->System should be a tab “Memory”, where you can configure how much memory is available as RAM, and how much is reserved for storing files.

This does not apply to the \ Permanent storage folder (or \ Memory card, as it is called on our device), but to other folders, for example \ Temp.

0
source

Source: https://habr.com/ru/post/1310483/


All Articles