Author |
Topic |
|
ctacke
877 Posts |
Posted - 19 Mar 2002 : 14:13:43
|
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
|
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. |
|
|
vboccanfuso
30 Posts |
Posted - 06 Aug 2008 : 13:45:19
|
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 |
|
|
ctacke
877 Posts |
Posted - 06 Aug 2008 : 13:48:43
|
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. |
|
|
vboccanfuso
30 Posts |
Posted - 06 Aug 2008 : 14:00:11
|
Thanks for the quick reply - can you tell me the name and location of the registry hive file? |
|
|
ctacke
877 Posts |
Posted - 06 Aug 2008 : 14:18:48
|
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.
|
|
|
vboccanfuso
30 Posts |
Posted - 06 Aug 2008 : 14:53:04
|
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? |
|
|
vboccanfuso
30 Posts |
Posted - 06 Aug 2008 : 15:08:50
|
Oops, wait a minute - wasn't showing hidden files - I see the files now. I'll try what you suggested and report back. |
|
|
vboccanfuso
30 Posts |
Posted - 06 Aug 2008 : 15:33:18
|
I tried renaming the hive files as you suggested but my change still didn't take effect. Any other ideas? |
|
|
vboccanfuso
30 Posts |
Posted - 06 Aug 2008 : 17:06:28
|
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 |
|
|
cbadr
154 Posts |
Posted - 07 Aug 2008 : 15:47:48
|
"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. |
|
|
ctacke
877 Posts |
Posted - 07 Aug 2008 : 17:38:36
|
You might just add ADSAlloc to your startup routine. |
|
|
vboccanfuso
30 Posts |
Posted - 07 Aug 2008 : 17:58:53
|
Great idea - Is there any example startup routine code you can point me to? |
|
|
ctacke
877 Posts |
Posted - 07 Aug 2008 : 18:04:15
|
Have a look at the first ADSCopy sample here. |
|
|
cbadr
154 Posts |
Posted - 07 Aug 2008 : 18:08:09
|
You can also simply put your exe in a startup folder. |
|
|
vboccanfuso
30 Posts |
Posted - 07 Aug 2008 : 18:10:36
|
Thank you both - you have been very helpful to this CE novice! |
|
|
|
Topic |
|