All Forums
 Microsoft Windows CE
 General CE
 Changing System Memory Allocated at Boot
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 19 Mar 2002 :  14:13:43  Show Profile  Email Poster
Q: Can I adjust the amount of system memory allocated at boot time?

Yes. You can adjust the amount of allocated boot memory by modifying the following key in ADSLOAD.REG:


HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MemoryConfig\ObjectStorePages


One page is 4096 bytes and the value required is a dword in hexadecimal format.

For example, to allocate 4 MB for the object store at boot, you would need 1024 pages (1024 x 4096 = 4,192,304) or 0x400, so you would make the following entery in ADSLOAD.REG:


[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MemoryConfig]
"ObjectStorePages"=dword:400


-----------------
Chris Tacke, eMVP
Applied Data Support

akidder

1519 Posts

Posted - 22 Jul 2002 :  18:29:13  Show Profile  Email Poster
This is the memory setting that is represented by the slider bar in the Control Panel -> System applet. This setting determines how much of the available RAM Windows CE dedicates for the file system ("Storage"). The remaining RAM is available for the application stack and heap ("Program").

You can also allocate program memory programmatically. See the ADSAlloc sample application.


Edited by akidder 20-Jan-2004: Add paragraph about Control Panel settings.
Go to Top of Page

vboccanfuso

30 Posts

Posted - 06 Aug 2008 :  13:45:19  Show Profile
Is the key below still used to set memory allocation in WINCE 5.0? I set it using adsload.reg and I see it in the registry, but the memory allocations don't change when viewed in System Properties/Memory

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MemoryConfig]
"ObjectStorePages"=dword:400
Go to Top of Page

ctacke

877 Posts

Posted - 06 Aug 2008 :  13:48:43  Show Profile  Email Poster
Keep in mind that ADSLOAD.REG may be applied before the registry hive is loaded. That would mean that a value in the Hive would override what you've set there. Try deleting the hive file from your device and see if the change takes effect.
Go to Top of Page

vboccanfuso

30 Posts

Posted - 06 Aug 2008 :  14:00:11  Show Profile
Thanks for the quick reply - can you tell me the name and location of the registry hive file?
Go to Top of Page

ctacke

877 Posts

Posted - 06 Aug 2008 :  14:18:48  Show Profile  Email Poster
As luck would have it, I have a device in front of me and can look.

\FlashFX Disk\Documents and Settings\system.hv
\FlashFX Disk\Documents and Settings\system.mky
\FlashFX Disk\Documents and Settings\DefaultUser.mky
\FlashFX Disk\Documents and Settings\DefaultUser\user.hv
\FlashFX Disk\Documents and Settings\DefaultUser\user.jjhv

Some are likely in use (like user.hv) but you can rename it and reboot (the system will recreate it) and then delete the renamed file.

Go to Top of Page

vboccanfuso

30 Posts

Posted - 06 Aug 2008 :  14:53:04  Show Profile
I don't have those files on FlashFX Disk or anywhere else. I'm using a Sphere II Dev Kit. Do you have any other ideas?
Go to Top of Page

vboccanfuso

30 Posts

Posted - 06 Aug 2008 :  15:08:50  Show Profile
Oops, wait a minute - wasn't showing hidden files - I see the files now. I'll try what you suggested and report back.
Go to Top of Page

vboccanfuso

30 Posts

Posted - 06 Aug 2008 :  15:33:18  Show Profile
I tried renaming the hive files as you suggested but my change still didn't take effect. Any other ideas?
Go to Top of Page

vboccanfuso

30 Posts

Posted - 06 Aug 2008 :  17:06:28  Show Profile
I think I can answer my own question. It appears that the MemoryConfig Registry key is no longer used according to the link below. Here are some excerpts from that link:

Q: What are the ways to set the way memory splits between storage & program memory? Or in other words, how do I set the size of the object store?

A: You have 3 options: Set the size in OAL code by implementing the pOEMCalcFSPages function. Set the size in OAL settings by changing the value of FSRAMPERCENT in config.bib. Set the size at run-time by calling the SetSystemMemoryDivision function. The CE control panel "system" applet has a slider that users can drag to adjust the size; that just calls SetSystemMemoryDivision.


Q: When I change the division dynamically using SetSystemMemoryDivision or by moving the control panel slider, does that value persist?

A: If your device always warm-boots, the object store will always be there so its size will not change on reboot. If your device always cold-boots, then the object store is recreated on every boot. The division is NOT saved anywhere so it will not persist across cold boots. Every time you cold boot you get whatever size is specified by FSRAMPERCENT / pOEMCalcFSPages. (The other variant of this question is: Why doesn't the registry value that stores the memory division seem to persist when the rest of my registry does? The answer is that there is no such registry value.)

Here's the link:

http://blogs.msdn.com/sloh/archive/2004/09/09/227599.aspx
Go to Top of Page

cbadr

154 Posts

Posted - 07 Aug 2008 :  15:47:48  Show Profile  Email Poster
"ObjectStorePages" is not supported on some of our systems. However, you can use the SetSystemMemoryDivision function, as you quoted above, in your own implementation of setting memory divisions, or you can use the ADSAlloc sample code from topic 553.
Go to Top of Page

ctacke

877 Posts

Posted - 07 Aug 2008 :  17:38:36  Show Profile  Email Poster
You might just add ADSAlloc to your startup routine.
Go to Top of Page

vboccanfuso

30 Posts

Posted - 07 Aug 2008 :  17:58:53  Show Profile
Great idea - Is there any example startup routine code you can point me to?
Go to Top of Page

ctacke

877 Posts

Posted - 07 Aug 2008 :  18:04:15  Show Profile  Email Poster
Have a look at the first ADSCopy sample here.
Go to Top of Page

cbadr

154 Posts

Posted - 07 Aug 2008 :  18:08:09  Show Profile  Email Poster
You can also simply put your exe in a startup folder.
Go to Top of Page

vboccanfuso

30 Posts

Posted - 07 Aug 2008 :  18:10:36  Show Profile
Thank you both - you have been very helpful to this CE novice!
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000