PDA Disk/Memory Allocation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I want to set the amount of device capactiy allocated for memory
programatically, how can I do this?
The device we are using is running out of memory while running and when the
OS reassigns Disk to Memory it sometimes causes the application to return an
out of memory exception anyways so I want to maximize memory avaliable from
the start.

Cheers,
James.
 
You can P/Invoke SetSystemMemoryDivision - see here for details of the
method:-
http://www.pocketpcdn.com/articles/memorydivision.html

declaration should be something along the lines of:-

[DllImport("coredll", SetLastError=true)]
private static extern bool GetSystemMemoryDivision(ref int storage, ref int
ram, ref int pageSize);

[DllImport("coredll", SetLastError=true)]
private static extern bool SetSystemMemoryDivision(int pages);

Peter
 
Thanks Peter.

Peter Foot said:
You can P/Invoke SetSystemMemoryDivision - see here for details of the
method:-
http://www.pocketpcdn.com/articles/memorydivision.html

declaration should be something along the lines of:-

[DllImport("coredll", SetLastError=true)]
private static extern bool GetSystemMemoryDivision(ref int storage, ref int
ram, ref int pageSize);

[DllImport("coredll", SetLastError=true)]
private static extern bool SetSystemMemoryDivision(int pages);

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net |
http://www.opennetcf.org

James said:
Hi All,

I want to set the amount of device capactiy allocated for memory
programatically, how can I do this?
The device we are using is running out of memory while running and when
the
OS reassigns Disk to Memory it sometimes causes the application to return
an
out of memory exception anyways so I want to maximize memory avaliable
from
the start.

Cheers,
James.
 
Back
Top