Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Help: I need to Get 2GB installed RAM working in Win98SE

- - - - -

  • Please log in to reply
135 replies to this topic

#1
EGOvoruhk

EGOvoruhk

    Newbie

  • Member
  • 43 posts
I've got 2 1GB sticks of RAM in my system. I know (or assume rather) I can't use 2GB with 98, but I need them installed because it's a multi-boot system. I installed 98 with just one of my sticks in, and then went about trying to work how to get the second one in. I began my search, and I was directed to this site for help. I finally got my system to boot with MaxPhysPage=38000 and MaxFileCache=30000, but now I have a different problem. Once in Windows, I can't get a command prompt to load without it telling me I have low memory. This also happens when trying load applications, or games

Any help would be appreciated. For now, I'm just going to start messing with the values, hoping to come across some magic, but I'm just shooting in the dark

Thanks in advance :thumbup


How to remove advertisement from MSFN

#2
galahs

galahs

    Advanced Member

  • Member
  • PipPipPip
  • 401 posts
Try these threads:

http://www.msfn.org/...howtopic=107342

http://www.msfn.org/...howtopic=105373

http://www.msfn.org/...showtopic=99263

Posted Image
Australia, it's time we became a Republic!


#3
Ninho

Ninho

    Member

  • Member
  • PipPip
  • 166 posts

I finally got my system to boot with MaxPhysPage=38000 and MaxFileCache=30000, but now I have a different problem. Once in Windows, I can't get a command prompt to load without it telling me I have low memory. This also happens when trying load applications, or games


Seems a bit strange to say the least. Not discussing your choices, you are willing to limit the mem used by Windows to slightly under 1 gigabyte - if my quick math is correct. The MaxFileCache value IIRC is decimal kilobytes, and 30000 seems acceptable if a tad small for your situation. As a consequence, it /should/ work... Please make absolutely certain you entered the required parameter lines in the respective right sections of your %windir%\system.ini file. The MaxPhysPage= should be under [386enh], while MaxFileCache= goes under [Vcache]. I know you must have been careful, but please... double-check before we try to reproduce or understand your problem !

Cheers

--
Ninho

#4
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

Hi, EGOvoruhk!
galahs pointed you in the right direction.
Those threads contain all our previous discussions and findings regarding win 9x/me with lots of memory.
I'm glad you got the system to work. As for the out of memory error with DOS boxes, I do have some
ideas about what may be happening. Yet, before writing many considerations based on guesses only,
let me ask you some questions:
Are you using XMSDSK? If so, what settings are you using?
What is the AGP aperture you are using?
Did you try to use more than MaxPhysPage=38000, after you had set MaxFileCache=30000? And what happened then?
Are you using EMM386.EXE or any other UMB manager?

#5
EGOvoruhk

EGOvoruhk

    Newbie

  • Member
  • 43 posts

Are you using XMSDSK? If so, what settings are you using?


Nope. No XMSDSK here

What is the AGP aperture you are using?


I set it to 32MB, which is the lowest I could set it to

Did you try to use more than MaxPhysPage=38000, after you had set MaxFileCache=30000? And what happened then?


I set them both at the same time

Are you using EMM386.EXE or any other UMB manager?


No. Everything I'm using is default. I just did a plain install, then SP 2.1a, and the ME system files update

#6
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

Thanks for the info. From it I guess you have no other place to improve your configuration outside windows. So, please, try reducing even further MaxFileCache to 16384, then restore it to 30000 and try using a bigger MaxPhysPage, but do each modification by itself, and check whether the low memory errors disappear or not in each case.

#7
galahs

galahs

    Advanced Member

  • Member
  • PipPipPip
  • 401 posts
How do you tell windows to place those files (operating system specific ones like the registry in particular) on a RAM disk

Posted Image
Australia, it's time we became a Republic!


#8
diskless

diskless

    Newbie

  • Member
  • 40 posts

How do you tell windows to place those files (operating system specific ones like the registry in particular) on a RAM disk

I could provide info tomorrow about the following:

1. Swap file on a RAM drive (dead easy)
2. Registry on a RAM drive, rest of Windows on a hard drive (easy)
3. All of Windows including registry on a RAM drive (also easy)

#9
galahs

galahs

    Advanced Member

  • Member
  • PipPipPip
  • 401 posts
If you would that would be great. I'm sure some other members would love to know too.


I know how to put the swap file on there but the rest I wouldn't have a clue.

Posted Image
Australia, it's time we became a Republic!


#10
oddjob

oddjob
  • Member
  • 1 posts

If you would that would be great. I'm sure some other members would love to know too.


I know how to put the swap file on there but the rest I wouldn't have a clue.

Use coa or setreg to put your registry into a ramdisk, alter the registry to point to the ramdisk letter you want to use then copy system.dat and user.dat over to it.
To put all of windows into your ramdisk first use subst to point to your ramdisk letter to a folder you create then install windows into that subst drive letter (similar to installing windows onto a cd)
Its all old hat preferred method for diskless win9x farms, nothing difficult and has shed loads of info of how to do it on google

#11
vick1111

vick1111

    Newbie

  • Member
  • 26 posts
Well it would be great to receive more information on how to install the virtual memory on the ramdrive.

I have just installed Windosws 98 SE on an Asrock 4coredual-sata2 -Intel core 2 quad processor -2 Gb of DDRII -

I believe that many new installation of windows 98 will be on a multiboot O.S. PC like mine and the one that started this post.

In a multi boot system new windows 98 users may have around 2 Gb of memory or may be even more.

The problem is what to do with this excess memory in windows 98.

Presently in my installation I have limited the memory used by windows 98 to 1Gb with the maxphispage (in system.ini) and to make the system work I had to reduce the MaxFileCache to 30000 (yes just 30000 cause more would not allow the start of dos window).

I am not very happy of the solution I have adopted and if possible I will try to put the Virtual memory on a ram drive.

I suspect that there can be some advantages and some disadvantages.

1 Disadvantage : using 1Gb of virtual memory on ramdrive and one Gb of memory can bring the risk of locking the system when the virtual memory is not enough for the system.

1 Advantage: It would solve the problems of the memory management bugs and a MaxFileCache enter would not be anymore necessary.

I would appreciate comments on this and also an explanation of why 1.8 Gb would be a good choice for virtual memory on ram drive in a system with 2Gb memory?

Infact i was thinking of something around 1 Gb for virtual memory on ramdrive in a 2Gb system.

1.8 Gb would leave just 200Mb of memory which seems not to be enough even for the agp video card memory needs.

With that setting I seriously doubt the system could work with my ATi Radeon 9600 using 256 Mb of memory.

So if someone could add some comments on how much memory give to the virtual memory ramdisk in a 2 Gb system or similar system it would be very welcome.

Also it would be appreciated some comments on how to avoid the lock up of the system after filling all the virtual memory.

Is 1 Gb of virtual memory enough to avoid any risk of lockup of the system??

Merry xmas to everyone
and thanks to all the wise posters

#12
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

Try these threads:

http://www.msfn.org/...howtopic=107342

http://www.msfn.org/...howtopic=105373

http://www.msfn.org/...showtopic=99263

There is one more thread worth reading:
http://www.msfn.org/...showtopic=79756

#13
vick1111

vick1111

    Newbie

  • Member
  • 26 posts
Well I have tried everything that was possible (given my knowledge of the problem) and I have not been able to make XMSDSK work without problems.

I have Windosws 98 SE installed on an Asrock 4coredual-sata2 -Intel core 2 quad processor -2 Gb of DDRII -

I have developed the idea that the MaxFileCache entry does not solve definetely the out of memory error.

In some cases no matter what the entry for the MaxFileCache or for MaxPhysPage I got an out of memory error when starting dos.
(I have verified memory values with system monitor)


---------------------
My failed attempts
---------------------
Even in the most favourable situation after starting 6 instances of dos windows,
the out of memory error appears again.


At one point I was able to make XMSDSk work without problem with:

c:\ramdisk\xmsdsk.exe 500000 z: /T /Y
(in autoexec.bat.)

At that point I did loose completely the use of Dos window.

(It is like some important memory resources are taken by the video card or something else and I have no clue about what is it! even if I have developed the idea that the solution is not in the maxfilecache settings : the solution must be in some kind of wise memory management I cannot find)

-----------------------------------
My present configuration (without XMSDSK)
----------------------------------
I have upgraded to service pack 2 for 98 SE.

and my present settings are:

autoexec.bat
mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)
mode con codepage select=850
keyb it,,C:\WINDOWS\COMMAND\keyboard.sys
LH /L:2 C:\WINDOWS\COMMAND\DOSKEY /INSERT
PROMPT $p$g
SET DIRCMD=/P /A

system.ini

[386Enh]
MaxPhysPage=40000
ebios=*ebios
mouse=*vmouse, msmouse.vxd
device=*dynapage
device=*vcd
device=*vpd
device=*int13
woafont=app850.fon
keyboard=*vkd
MinSPs=16
ConservativeSwapfileUsage=1
DMABufferSize=64

[vcache]
MinFileCache=3000
MaxFileCache=393216

(rest is omitted)

config.sys
DEVICE=C:\WINDOWS\HIMEM.SYS /TESTMEM:OFF /Q
DOS=HIGH,UMB
DEVICE=C:\WINDOWS\EMM386.EXE NOEMS X=A000-F7FF
DEVICE=C:\WINDOWS\setver.exe
device=C:\WINDOWS\COMMAND\display.sys con=(ega,,1)
Country=039,850,C:\WINDOWS\COMMAND\country.sys


(I have tried and cannot use UMBPCI.SYS at the place of EMM386 cause my motherboard is not supported)


EMM386.exe did work only with the setting: X=A000-F7FF .

I do not think that EGOvoruhk either has solved the problem????

In this configuration I am able to start 2 (two) fresh dos windows before I get the out of memory at the 3rd dos istance.


-----------------------------------
XMSDSK Failure
-------------------------------------
Whenever XMSDSK succesfully creates a ram drive then my dos windows become unavailable for the "out of memory error"

MOREOVER XMSDSK does not work properly: when I start the scandisk, to check the sectors into the ramdrive Z, the write attempt fails after a while.
A more simple copy write attempts fails too.

The failure happens not at a specific point.

what happens is that I got a blue screen with not recoverable error sayng things like:

"An exception 0E has occurred at 0028:C0004D6D in VxD Vmm(01) + 00003D6D. This was called from 0028:C19359C4 in Vxd Rmm(01) + 00000254"

I have tried many different settings for XMSDSK.

(Some example :

c:\ramdisk\xmsdsk.exe 1800000 z: /T /Y
c:\ramdisk\xmsdsk.exe 1100000 z: /c1 /T /Y
c:\ramdisk\xmsdsk.exe 500000 z: /T /Y
c:\ramdisk\xmsdsk.exe 500000 z: /c64 /T /Y
c:\ramdisk\xmsdsk.exe 500000 z: /c1 /T /Y
)

#14
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,059 posts
  • OS:none specified
  • Country: Country Flag
Cannot really say if it can help, not even if it works at all, but you can try using the "other" DOS ramdisk, SRDISK:
http://sourceforge.net/projects/srdisk

jaclaz

#15
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

First of all: remove EMM386 from your CONFIG.SYS! It's not required for windows and this results in memory management way worse than standalone VMM.VxD. And in the configuration you are using it, it is not able to provide UMB, so it is pointless to use it anyway. And don't forget to change the DOS statement to "DOS=HIGH" without the ", UMB".

Now, Exception 0E is a Page Fault. XMSDSK is trying to access memory that isn't there. I think I know why, so bear with my somewhat longish reflection below, please.

Some time ago, Tihiy (in this post) pointed to a russian language page, by Igor Petrovitch Leyko (Nov 03, 2005), about win 98 memory problems (link), and while no automatic translator did a good job at translating it, Google Language Tools gave me a good start, and from that start I've done my best to produce a good enough English translation of a short excerpt of that page, which I find relevant to the present discussion:

"Right-click on the My Computer icon, choose Properties from the menu, then the Device Manager tab. Right-click the Computer icon (at the top of the list) and then choose Properties. In the window that appears, choose Memory. In the resulting list of addresses assigned to devices locate the first entry from the fourth gigabyte (= the range C0000000-FFFFFFFF). The entry you want is the one that has the address nearer to C0000000 or farther from FFFFFFFF (which are two ways of saying the same thing). Subtract C0000000 from that hexadecimal number you just found (using the the standard Windows calculator's Hex mode), convert the result to decimal (by selecting the calculator's Dec mode) and divide by 1024 (all of the calculation is easily done with the calculator in scientific mode). The resulting number is the maximum allowable size of the disk cache (it is stated in kilobytes). Open the system.ini file, find the section [VCache] and fill it with a string MaxFileCache = xxx, where xxx is the number you just calculated. If you later add another hardware device to the computer, it may require the repetition of these calculations, and will leave less space for the cache."


Just to avoid any misunderstandings, let me say that, in my own system, when I perform the above procedure, I find, as the device with lowest memory address range: "EC800000-EC8000FF Via Rhine II Fast Ethernet Adapter" and hence, by doing the calculations with EC800000, reach a value of 729088 kB.
But the real problem is what does this value really mean?
Well, my own experiments show that if I set MaxFileCache=729088 or to any value above 131072, I get "Insufficient Memory to Initialize Windows" and the system simply doesn't start at all. Yet, MaxFileCache=131072 still leads to a "There is not enough memory available to run this program" on starting a DOS box, usually the third or the fourth, sometimes even the first. So I settled down to use MaxFileCache=114688, and now I can start 28+ DOS boxes, before getting the "There is not enough memory available to run this program" error. All this using a XMSDSK of 262272 kB, and having an AGP aperture of 65536 kB. But if I expand or reduce the XMSDSK size, the number of DOS boxes I can open diminishes or increases, respectively. Further tests seem to indicate that the memory value reached per Igor Leyko's proposed calculation is the total memory pool available for XMSDSK, VCache, the AGP aperture, and the DOS boxes. In my system this means 262272+114688+65535=442496 and 729088-442496=286592 is the free space my DOS boxes use, when created. Bear in mind that my system has 1.5 GB of RAM and I'm using MaxPhysPage=48400 (1156 MB) now. Be warned that, except for the text from Igor Leyko that I cited, all the conclusions presented here are mine own, based solely on my limited experiments on my own computer, so: (1) I may be wrong and (2) even if I'm not, YMMV. Happy holidays!

#16
vick1111

vick1111

    Newbie

  • Member
  • 26 posts
Thanks Dencorso, I am going to use your suggestions. The russian page seems to contain useful concepts (too bad it is not in english) !

In the Mean while
Happy new year and Best wishes for a better 2008 to everyone in this forum!!!

#17
diskless

diskless

    Newbie

  • Member
  • 40 posts

<snip>
Well, my own experiments show that if I set MaxFileCache=729088 or to any value above 131072, I get "Insufficient Memory to Initialize Windows" and the system simply doesn't start at all. Yet, MaxFileCache=131072 still leads to a "There is not enough memory available to run this program" on starting a DOS box, usually the third or the fourth, sometimes even the first. So I settled down to use MaxFileCache=114688, and now I can start 28+ DOS boxes, before getting the "There is not enough memory available to run this program" error. All this using a XMSDSK of 262272 kB, and having an AGP aperture of 65536 kB. But if I expand or reduce the XMSDSK size, the number of DOS boxes I can open diminishes or increases, respectively. Further tests seem to indicate that the memory value reached per Igor Leyko's proposed calculation is the total memory pool available for XMSDSK, VCache, the AGP aperture, and the DOS boxes. In my system this means 262272+114688+65535=442496 and 729088-442496=286592 is the free space my DOS boxes use, when created. Bear in mind that my system has 1.5 GB of RAM and I'm using MaxPhysPage=48400 (1156 MB) now. Be warned that, except for the text from Igor Leyko that I cited, all the conclusions presented here are mine own, based solely on my limited experiments on my own computer, so: (1) I may be wrong and (2) even if I'm not, YMMV. Happy holidays!

My Win98SE system has 512MB total RAM, with 384MB used as an XMSDSK RAM drive. After hours of image editing, browsing, emailing and whatnot, I closed all the apps apart from one Explorer window and then started a DOS box test. I ran out of memory on the 84th MS-DOS Prompt. What am I doing wrong? :lol:

Edited by diskless, 03 January 2008 - 11:55 AM.


#18
gosh

gosh

    gosh 2.0

  • Patrons
  • 2,347 posts
  • OS:none specified
  • Country: Country Flag
It's important to remember that in windows 98 the limit is not really the memory, but the SYSTEM RESOURCES. Win9x has a limit for how much memory it can use for stuff such as paint brushes, handles, things like that. So even if you have 2 gigs of ram you might only have 70% system resources free and might run out of memory. This is a system limitation which is not in Windows NT. You're better off just limiting the memory win98 can use up to 1 gig. Windows 98 was not tested for use over 1 gig and has bad performance over 1 gig of memory.

-gosh

#19
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

@diskless: You're doing nothing wrong, but with just 512 MB you'll NOT run into any of the problems/limitations that appear on machines with thrice or more that amount of RAM, no matter what strange configuration you use.

My point was that during startup Windows remaps all XMS memory already alocated before starting Windows to addresses in the fourth GB (downwards from 4 to 3 GB, starting at the highest free address) just as if that memory was owned by some hardware device, and all free memory that it can see (up to 1156 MB, AFAIK, with an unpatched VMM.VxD) in a continuous block starting at 0 GB upwards, and I have no firm idea about what it does with any remaining memory (but it seems reasonable to imagine it would be mapped just above the end of the memory Windows detects). To form a picture of what I'm talking about, just imagine the following case: 2 GB of RAM of which 512 MB is allocated to XMSDSK and 1156 MB as normal memory: where will the remaining 380 MB be allocated? Bear in mind that HIMEM sees it all... And then, there still remain the AGP aperture and VCache to consider, but such memory is mapped in the 4th gigabyte, anyway...

@gosh: very true. We're still looking for ways to overcome the Resources limitation.

@Ninho (in view of the post below): Thanks for the corrections, you are right, of course! And yes, I am talking about virtual memory addresses. Windows organizes its virtual memory arena as 1GB for devices and the like (the 4th GB) on top of 3GB of system's and applications' space, whatever the real amount of RAM present.... I have now corrected the text above, using a red font for the corrections. You rock! :thumbup

Edited by dencorso, 02 January 2008 - 08:48 PM.


#20
Ninho

Ninho

    Member

  • Member
  • PipPip
  • 166 posts
@dencorso : "Windows remaps all XMS memory already alocated before starting Windows to addresses in the fourth MB (downwards from 4 to 3 MB, starting at the highest free address) just as if that memory was owned by some hardware device, "
"And then, there still remain the AGP aperture and VCache to consider, but such memory is mapped in the 4th megabyte, anyway..."

I guess you mean GiB, not Megs... Surely a typo, though an unfortunate one since the subj is already clear as mud...

Also for things to be as clear as possible, I guess your are talking in terms of virtual, not physical addresses. This may be self evident, but I'm sure more than one has been confused over such subtleties.

With this in mind, let's see if I understood well : dare I ask, what you are saying amounts to Windows/VMM at startup remapping to system memory space (the 3rd virtual gigabyte) any XMS memory blocks that were allocated (in DOS presumably) before Win started ? Makes sense !

--
Ninho

#21
GreyPhound

GreyPhound
  • Member
  • 8 posts

Some time ago, Tihiy (in this post) pointed to a russian language page, by Igor Petrovitch Leyko (Nov 03, 2005), about win 98 memory problems (link), and while no automatic translator did a good job at translating it, Google Language Tools gave me a good start, and from that start I've done my best to produce a good enough English translation of a short excerpt of that page, which I find relevant to the present discussion:


dencorso,

Well done job!
It inspired me to expand the translation a bit further, with your piece copied and pasted almost in its entirety (the ending of the last sentence was slightly modified to more accurately reflect the original.) This translation is approximately half of the original text (the second part of it.) If /when I have more inspiration, I will translate the introductory part of the article as well. It should be mentioned here, that in Russian forums Igor Leyko (Microsoft MVP) is a well regarded person, respected for his deep and intimate knowledge of Win Oses.

GreyPhound

``````````````````````
Windows 9x and lots of memory: Dotting the i's

Let's start with traditional "excuses". The functions in question, OS work specifics and applied algorithms are documented extremely poorly, or not documented at all. The information I have mined from various sources seems to be partially contradictory. I did my best to put all the pieces together, but no guarantee can be given that I’m not mistaken in some way. My attempts to reach out to people with good knowledge of internal modules of the OSes mentioned here have failed, as too many years passed. And in some cases nothing but reconstruction had to be done, similar to how with a few found bones appearance of a dinosaur would be identified. Therefore, if you find a mistake or inaccuracies, your comments would be appreciated. Now, let's get back to the subject at hand.

Although Windows 98 and Windows Me can surely be described as outdated systems, they still run on quite a lot of computers. For various reasons: computer power is not enough to "haul" a modern OS, or because of programs and hardware that will not work under Windows 2000 and XP.

And if old machines will have only one problem with memory - its deficiency, the situation with newer ones seems to be more complicated.

For example a company has a certain accounting program on an old machine written many years ago, and it still suites the needs of the user. If for some ill luck the old computer is broken, on a new one the program would not work under XP. Or someone has an old scanner, which is used occasionally and the owner is happy with it. But WinXP drivers for the scanner do not exist, you grudge buying a new one - and why shouldn't you, if the old one works!

The most evident solution in these circumstances is to install Windows 98 or Windows Me on a new computer, either in a dual boot configuration, or as a single system.

However, if your computer has a fair amount of memory, then these OSes could fail to install at all, or hang during work every now and then. It is not for nothing, that in forums and discussion groups, you hear statements about Windows 98 being unable to utilize more than 512 Mb of RAM.

Let's try to find out what's the problem here. Let's exclude at once situations when new hardware doesn't have drivers for Windows 98 (it is presumed here that Win98, if not otherwise mentioned, will comprise three operating systems Win98, Win98SE and WinMe), hyperthreading is not switched off in Pentium 4 processors and so on. We are talking about only one thing: specifics of how Windows 98 handles large amounts of installed RAM.

As a rule, with memory not more than 512 Mb you are unlikely to run into problems. With an extremely unfortunate combination of hardware and programs in use, that occupy a small amount of memory, but are processing large amounts of data, a system may hang on rare occasions even with smaller amounts of RAM, however this situation will not happen often and will usually be chalked up to system glitches.

But if memory is more than 512 Mb, problems will occur more often, leading to a complete hang, or making it impossible to install a system or load it when memory is added after installation. Or the computer will go into cyclical rebooting.

Extraction of "redundant" modules will usually prove to be a radically effective remedy, and the problems will be gone as if by magic. But this solution can hardly be called satisfying - not everyone will agree to open his computer and extract memory before Win98 launch and put it back when starting WinXP.

So what a smart user would do in this juncture? That's right: he will go to Microsoft knowledgebase site. And with some search experience he will quickly find the articles which describe this problem or similar ones: 184447, 253912, 304943, 311871.

It may well happen that after reading them your head will be swimming. Therefore, let's figure out what is written in them and how one is to comprehend that.

Carefully analyzed, the article 311871 can be set aside. Its style and comprehensiveness makes it stand out from the other ones, and it can be presumed with certainty that it was written by one of my MVP colleagues, undoubtedly with good knowledge of Windows 98 but not familiar enough with its inner layouts.

An assertion that this system is not meant to use 1 Gb of RAM is incorrect. It was designed to be used with up to 2 Gb, but as a rule, the actual limit, due to solutions inherited from preceding versions is less.

Igor_Leyko_1E.gif

I witnessed (by correspondence, in a discussion group) the very first case of Windows 98 with a large amount of memory working abnormally. In February 1998, one of the beta testers attempted to install Windows 98 (probably, it was RC0, not beta already) on a server with one gigabyte of memory. During installation a blue screen with a message about insufficient memory to initialize Windows popped up. The installation could only be continued after the memory had been reduced to 928 Mb.

Not a single developer has ever mentioned that the system was not designed to utilize a gigabyte. Quite the contrary, the answer was something like: "the system is designed to use up to 2 Gb of RAM, therefore it must be a mistake of some sort, but for lack of time we will not look into it right now due to shipping deadline, and then it's unlikely an average user will ever encounter this issue." Undoubtedly a fair statement, if you remember a typical computer configuration back at that time. Suffice it to say that the gigabyte in that ill-fated server was made up using 16 Mb modules.

Other knowledgebase articles say that disk cache should be limited to 512 Mb, and the amount of RAM to 1 Gb, 768 Mb or even to 512 Mb - various articles will have it differently.

The article 253912 mentions briefly allocation of addresses to cache in the fourth gigabyte, it also says about a possibility of limiting the size of cache. But article 304943 says that in some cases limiting cache doesn't help, and that the amount of used RAM should be reduced.

So the knowledge base acknowledges that with large amounts of RAM Windows may refuse to boot, or will work unreliably. But what's the issue then if the developers talked about two gigabytes with confidence?

So it's clear that nothing is clear. Nobody seems to know just everything, and if somebody does - then he wouldn't tell you, and "trimming" or physical reduction of RAM is often presented as the only viable option. Let's get down to the gist of the problem.

Let's start with how Windows utilizes memory.

32 bit address space in 80386 (and up) processors is divided into memory pages sized 4 Kb each. Each of these pages is managed independently form one another. There maybe many instances of such address space, but actual (physical) address space is available only to the system kernel and drivers, and only they can directly address physical memory. Other system components and all application programs work in virtual address space, with virtual addresses.

The concept of "virtual memory" is somewhat ambiguous. Quite often it is used as contradistinction to the concept of "physical memory", but in general, virtualization should be understood as a form of abstracting from a real device. Obviously, a program can only be executed from physical memory - and not when its code is unloaded to the swap file. However, a program itself usually can not determine if its pieces are in physical memory, or unloaded to the disk. Nor can it determine where exactly in physical memory its code and data is - the operating system translates RAM addresses to which a program calls in its virtual address space, into those addresses that a program actually occupies in physical memory. If part of the virtual memory addressed by a program is unloaded to the disk, the OS halts the program and loads a needed page to the physical memory, and the program afterwards will proceed as if that page was always in the memory.

To provide for such a translation, the operating system maintains a special table of pages, in which currently mapped virtual pages, physical memory areas and swap file areas where data is really kept are indexed.

There are several such tables - for every program a separate table is kept. Different programs may use one and the same virtual addresses, but each program will have its own map of virtual and real pages, so that in reality different physical memory areas will be addressed.

Since we have touched memory allocation, let me mention here, that memory is allocated to a program only on its calls. The operating system can deny a program memory allocation, but it can not allocate memory to a program more than it has called for. Therefore, questions asked sometimes: "Why does not the OS release all the memory to my favorite program, when we still have lots of free memory" are pointless. To "overfeed" a program with memory, that is - force it into using more than it wants itself is impossible.

So, we have figured out that physical addresses space should be distinguished from virtual one. One of the operating system kernel components - memory manager, among other things takes care of translating virtual addresses used by programs and other kernel components to physical memory actual addresses.

In Windows 98 memory is allocated as follows (see the diagram below.) On the left - actual allocation of address space of programs and the system is shown, on the right side, an example of allocation of physical memory.

2.gif

All programs virtual address space is divided into four areas. The first area occupies the range of addresses from zero to 4 Mb and is not addressable by Windows programs. For DOS programs and drivers the situation is slightly different, but discussing those specifics will distract us from the topic, therefore we will not go into details here.

The area from 4 Mb to 2 Gb is the working area for programs. From a programs’ standpoint this area is filled with RAM up to the quantity needed by a program (and of course, not more than 2 Gb), as already mentioned, each program has its own memory, which has nothing to do with the memory allocated to other programs.

The third gigabyte is used as virtual address space, common for all the programs and the system. Windows loads its graphical core into this area, as well as dynamic libraries. Obviously, in reality these modules are located in the actually available physical memory in areas of significantly lower addresses, but a mechanism is needed to enable programs to address the system modules. Virtualization is such a mechanism.

The fourth gigabyte (addresses from c0000000-ffffffff) is also common for all programs and the system, but it is used for several purposes. Firstly, the system loads its kernel there, drivers and other modules which work on kernel level (if there are such modules in the system.) This area is virtualized just as the third gigabyte is.

Secondly, in this address space an area of memory is allocated to be used by disk cache (VCACHE), also virtualized.

Third, in this same gigabyte there are memory addresses (actual, not virtualized) of those IO devices that provide for direct access to their memory.

Fourth, it is here that address space is allocated for DOS virtual machines.

Let's see more details of how the fourth gigabyte is used.

The system kernel is allocated address space in the same way as common modules, and doesn't need additional explanations; therefore let's get straight to talking about the disk cache.

When more than ten years ago, Microsoft started developing its dynamically changing disk cache (VCACHE module first appeared in Windows 3.11 for work groups, released in 1993), gigabyte memory sizes seemed as something from science fiction. For those who didn't know, the first IBM PC, released in 1980 had 64 Kb of RAM, and in 1993 computers with four megabytes were the norm. Extrapolating to our time, it would seem that in 2006 one would expect 256 Mb of RAM in mass manufactured computers. Besides, no one even thought, that this OS and its direct offspring would last this long.

So programmers had no reason to be concerned with economizing address space, and openhandedly the fourth gigabyte was allotted among other things, also to address space of the disk cache. It turned out to be less to one's cost to allot linear virtual address space to variable size cache, and afterwards map it through a memory manager to actually used physical memory, than constantly taking stock of allocated memory in the cache module itself.

For this reason, during system boot, part of the address space in the fourth gigabyte is reserved for use by the disk cache. The size of this part depends on the operating system version, some hardware characteristics, and amount of RAM installed on the computer. Usually it equals the amount of RAM, but has an upper limit of 800 Mb.

Another purpose for using the fourth gigabyte is to provide access to device memory. If you lived in the times of DOS, you should know that to boost work speed, it was not uncommon for programs to write their data directly to device memory, video adapter for example (EGA or VGA.)

With advent of 32 bit processor work mode, nothing has changed in this regard. As before, direct write remains the quickest way of calling a device, only device memory addresses have been removed from the first megabyte to the end of the area being addressed, to that same fourth gigabyte. And also, there is usually a layer in the form of a driver
between a program and a device.
DOS virtual machines also have their address allocation in this very fourth gigabyte, where your DOS programs are executed. With all this going on, there comes the need for a dual retranslation: when a program calls an address in the first megabyte, instead of it a corresponding address of a virtual machine is given, (in the fourth gigabyte), and since this is a virtual address, a second redirection is taking place - to an address of the physical memory, where a required page of the virtual machine is located. Such is the cost of support for old programs. However, the actual burden isn't that big.

But let's get back to the common problems of the fourth gigabyte.

Unlike Windows XP and other NT based OSes, Windows 98 has one, and only one address space for two upper gigabytes. It turns out to be shared by both virtual memory and device addresses, and it has to be sufficient to be used in all modes, otherwise the work of the system will be broken.

As a rule, the OS can't influence the use of addresses of the device memory - these addresses, in most cases, are fixed by the hardware.

Let's see now how memory is allocated during Windows boot. The very first phase is DOS boot. Afterwards, from there Windows kernel is loaded - VMM.VXD. This file has many modules, and one of them is VM manager (in particular, it manages memory allocation,) by its structure it's a plain DOS program. But only by its structure. And only to make it possible to be started from DOS. Once started, it shifts the processor to protected mode and uses DOS mainly as a driver for various services, first of all the disk and video adapter.

Then VM manager starts loading into memory other modules (drivers) which are located in VMM.VXD, drivers which are referenced in the registry or in system.ini, and also those called earlier by loaded DOS programs (as an example, disk caching program smartdrv can be given, which on Windows boot passes a demand to it to load the smartdrv.vxd module, which is kept in the body of smartdrv.exe.)

But here we have a vicious circle. To load a driver to memory, this memory needs to be allocated to it, and while being allocated - correspondingly indexed in the pages table. And to allocate space for pages table, memory needs to be distributed in advance. Therefore, VM manager performs allocation in two moves: first, a small, but absolutely available area of memory is allocated, into which driver bodies are loaded. A table of pages is also built there. In the second phase of actual initialization, drivers' requirements for memory are analyzed and they are allocated virtual addresses in the fourth gigabyte.

If your boot log is on during Windows boot, these phases will be clearly visible there (bootlog.txt). First come pairs of messages Loading and LoadSuccess for each driver, VM manager and drivers initialize: SYSCRITINIT and SYSCRITINTSUCCESS.

3.png

The main "hog" of address space, undeniably is VCACHE. As mentioned earlier, it demands for itself address space approximately equal to the amount of RAM, but not more than 800 Mb. As result, total demands of this and other modules can exceed the gigabyte allotted to them. WinMe in this respect is more effective and more efficiently allocates address space, therefore given a choice, it is preferable to chose it over the other 9xs.

But if it's still impossible to allocate all the virtual memory required by the system and all the drivers, then as a rule, Windows 98 will give a warning about insufficient memory, and Windows Me will reboot (although it can be the other way round too). But since there will not be enough address space next time - rebooting becomes cyclic. At that, there is no initialization entry in the log, it ends when drivers are loaded.

Igor_Leyko_4E.png

5.png

If address space deficiency is not too big, it's possible that the system will load in safe mode, when the number of drivers and the required address space decrease. But don't hold your breath.

Sometimes you have enough address space for initialization, but you have practically, almost run out of stock. In this case the system will boot normally, but an attempt to start a DOS program will lead to a mistaken warning. If free address space still remains, but not too much of it, then some DOS programs may start, but those that require more memory – will fail.

But what can be done if there's not enough address space and the system will not boot, or DOS programs do not start? Alas, the problem can only be solved in two ways. If you have Windows 98, you may try switching to Windows Me. The second, more universal, but less productive way is to limit the amount of the used memory (detailed instructions are in the end of this article).

Apparently, you have a question: if the issue is disk cache that does not have enough virtual address space, then why not shrink its size, as Microsoft knowledgebase would suggest? Unfortunately, it will not help. As a matter of fact, memory allocation is performed by VM manager, and it looks only to its own section of the system.ini file [386Enh]. And cache size limitation is determined in some other section, and it affects only how cache itself will work, in particular how it will use its allocated address space.

However, shrinking the size of cache most probably will prove to be a useful operation. Why? That's what exactly we'll talk about now.

So, the system boots, DOS programs can start, but no work can be performed - shortly thereafter the system either hangs or it shows a blue screen of mistake. What else does it need?

Let’s draw an approximated address space layout in the fourth gigabyte (this is how it looks on authors' Windows 98 computer, some details have been omitted for simplification); at that we will have two diagrams: one for physical space, the other for virtual one.

6.gif]

Note: To avoid misunderstanding, it should be mentioned that booting only Windows kernel without the graphical interface has nothing to do with booting with BootGUI=0 parameter set. In the latter case, Windows as a matter of fact does not load at all; it is only MS-DOS, which is part of it that loads. However, some documentation mentions also "real kernel mode Windows".

Also, note that part of the addresses range occupied by an AGP video adapter has been occupied in two instances (if the adapter uses PCI-E bus, the picture will change less, and therefore we will limit ourselves with the most common situation.)

If this address area is being used by a video adapter, then why the system has allocated it to the cache virtual memory?

The answer is very simple: modern display drivers usually consist of two parts - the core, in the form of a virtual device driver (vxd) and a main part, in the form of dynamically loaded libraries. When the system kernel loads, only the core of a video adapter is loaded too. It only provides for realization of basic functions of the video adapter, approximately at the VGA level, that's why it does quite well with corresponding addresses area in the first megabyte or in addition to that, small areas of memory occupied by the adapter in the upper addresses of the fourth gigabyte. When initializing memory VM manager allocates to the video adapter core the area it has called for, but it can not get the information that later at graphical subsystem and all driver files load, this driver will need some more areas of the address space. So the manager allots free areas to VCACHE address space.

Afterwards the graphical core of Windows is started, and with it comes the video adapter driver in full. This driver initializes all the functionality of the video adapter and in the addresses zone used by the adapter a physical device appears. If the same zone is also allotted to the disk cache, when VCACHE is trying to address it a conflict arises between the device driver and cache. Normal work of the system is interrupted.

It's important to know that the conflict arises not because cache has been allocated this area of addresses, but because it starts to work with it. This makes avoiding conflicts pretty simple: all that needs to be done is to limit a maximum cache size.

As a rule, AGP devices use addresses starting from E0000000, that is 3,5 Gb. Disk cache at that can use a half gigabyte. This is exactly what determines a recommendation to limit cache to the value of 524288 Kb (512 Mb). Normally, such a limit will be effective. But not always a video adapter will be allocated exactly this address area, besides other devices may behave in similar ways. TV tuners, for example. Therefore, more radical limitation of cache may be required.

Let's get to practical recommendations now - how to install Windows 98 on a computer with more than 512 Mb of RAM.

1. What's needed done first is to forget, once and for all, EMM386 and other memory managers, more or less stable work, or even (system) booting can't be guaranteed with them.

It is also desirable not to place an explicit call for himem.sys in config.sys - let Windows load it automatically. Although, I have no explanation whatsoever for this piece of advice and can't myself understand why does it have to be this way, but in some cases, it does work.

2. When installing WinMe, have a boot disk, or some other bootable media. It should come with a text editor, as you may need to edit the system.ini. file.
For a Win98 installation no diskette is required, as DOS can always be loaded (Command prompt only) and edit started from there.

3. Let's start an installation. Three options are available:

1. Leave less than, or 512 Mb, in the computer, do a system install and tune up, and only afterwards add all the memory, followed by another tune up.
2. Tune up is performed in advance - stricter than required - and after the installation, reduce the limitations so long as the system still works.
3. Start a system install, and adjust the parameters as needed.

To my personal liking, point 3.3 is the way to go.

What is needed for point 3.1 is pretty clear: take nearly all the memory out of the machine. If a RAM module is 1 Gb, or more - this option is obviously not acceptable.

To follow point 3.2, prior to installation, the system.ini file needs to be created, with a single short entry. On the disk with Windows to be installed, create an installation directory (usually it's Windows). Create a file named system.ini there, with two lines:
[386Enh]
MaxPhysPage=10000

Once done, you can proceed with installation. These lines will force VM manager to use from the outset only 256 Mb of RAM. If this amount of RAM is what you need, you can keep this setting for your work and not waste your time on adjusting it to the current configuration.

To install as in point 3.3, nothing needs to be done in advance if you are installing Windows 98; however, it's a must to have a bootable diskette (or other media) in case of a WinMe installation.

Start a normal installation. If Windows gives a warning about insufficient memory for initialization, or goes into reloading - in Windows 98, press Ctrl key during load, and select Command prompt only from menu. In Windows Me you will have to boot from a diskette or other media.

Open system.ini file for editing, go to [386Enh] and a line MaxPhysPage=value. In Windows 98 you can start with the value 40000, in WinMe - 60000. Save the file and reload the computer, to try proceed with installation. In case of a failure, re-edit the file and reduce the first digit of the value by one. Continue this procedure till a successful installation.
4. Once the installation is complete, it makes sense to sort out a maximum amount of physical RAM. To do this, repeat once again the procedure in point 3c (?) - only this time increasing the value, until the system stops loading.

Afterwards, go back to the previous value and increase it by a smaller amount. It will be convenient to use an increment reduced by a factor of two. For example, if the system loads with the value of 40000 and does not load at 50000, it's worth trying an average value 48000 (this value is hexadecimal - and it shows a number of pages of physical memory the system can use.) If the system loads - try 4c000, if it doesn't - 44000 and so on. Don't go too far however - one in the fourth order means 16 Mb, and therefore, three zeroes in the low order are not worth touching - the benefit will be scanty.
1. Running programs under DOS may require an additional cap on the amount of memory. Run your DOS programs or games to check on how they work. If a program doesn't load or crashes, reduce the value of the parameter by 1-2 units in the fourth order. Most of the time this will be enough.

5. Setting the disk cache.

This setting does not require matching, but preferably it should be done after all the drivers are installed.
Right-click on the My Computer icon, choose Properties from the menu, then the Device Manager tab. Right-click the Computer icon (at the top of the list) and then choose Properties. In the window that appears, choose Memory. In the resulting list of addresses assigned to devices locate the first entry from the fourth gigabyte (= the range C0000000-FFFFFFFF). The entry you want is the one that has the address nearer to C0000000 or farther from FFFFFFFF (which are two ways of saying the same thing). Subtract C0000000 from that hexadecimal number you just found (using the standard Windows calculator's Hex mode), convert the result to decimal (by selecting the calculator's Dec mode) and divide by 1024 (all of the calculation is easily done with the calculator in scientific mode). The resulting number is the maximum allowable size of the disk cache (it is stated in kilobytes). Open the system.ini file, find the section [VCache] and fill it with a string MaxFileCache = xxx, where xxx is the number you just calculated. If you later add another hardware device to the computer, it may require the repetition of these calculations, and further shrinking of the cache size.

Now, you shouldn't have problems caused by large amounts of memory.

If Windows 98 is the only OS on your computer, let me give you a piece of advice. Do not try to increase the amount of memory above what Windows can work with. In some cases a converse effect can be observed: after adding another (RAM) module, you may need to set a new, lower limit of the usable RAM.

Sometimes, another gigabyte added to a machine that works with 1 Gb of RAM, forces the amount of used RAM to a limit of approximately 900 Mb - in other words not only the amount of used RAM does not increase, but it even decreases. On my computer with 2 Gb, WinMe needs just a slight limiting of memory, and adding a third gigabyte of physical memory, the amount used by Windows has to be limited to 1.5 gigabytes. That is, increasing the actual amount of RAM reduces the amount that the system can use.

So before investing in memory, try checking first how exactly your computer and OS will react to its expansion. In reality, the upper limit most of the time is slightly more than one gigabyte for Windows 98, and slightly less than 2 Gb for WinMe.

Igor Leyko, MS-MVP
Nov 03, 2005
`````````````````````````````

#22
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

dencorso,

Well done job!
It inspired me to expand the translation a bit further, with your piece copied and pasted almost in its entirety (the ending of the last sentence was slightly modified to more accurately reflect the original.) This translation is approximately half of the original text (the second part of it.) If /when I have more inspiration, I will translate the introductory part of the article as well. It should be mentioned here, that in Russian forums Igor Leyko (Microsoft MVP) is a well regarded person, respected for his deep and intimate knowledge of Win Oses.

GreyPhound
[...]


:thumbup Way to go, GreyPhound! Thanks a whole lot! You do rock! :thumbup

BTW, let me ask you one thing, please: does, perchance, "железа" mean "hardware"?

Edited by dencorso, 02 January 2008 - 09:07 PM.


#23
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

[...]

With this in mind, let's see if I understood well : dare I ask, what you are saying amounts to Windows/VMM at startup remapping to system memory space (the 3rd virtual gigabyte) any XMS memory blocks that were allocated (in DOS presumably) before Win started ? Makes sense !

--
Ninho


Ninho:
Thanks for the heads up. I've, now, corrected my post.
But I forgot to answer your question, so I'm doing it now:
Yes, you've got it right. That's exactly what I meant.
And XMSDSK is just a good example of a program that allocates XMS from DOS (run from autoexec.bat or from config.sys), before Windows even begins to load. There are other examples, but I think ramdisks are the most useful nowadays. I think Igor Leyko didn't cover this subject in his article because it would render even more complicated a subject that, as you yourself have said, is not easy at all. But in the present thread it is unavoidable to consider the case of ramdisks, because, IMHO, they are a must for systems having more than 1GB of RAM installed.

#24
GreyPhound

GreyPhound
  • Member
  • 8 posts

BTW, let me ask you one thing, please: does, perchance, "железа" mean "hardware"?

In computer parlance - yes it does. However, the prime, 'dictionary' meaning of the word is 'iron'.

#25
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,789 posts
  • OS:98SE
  • Country: Country Flag

Donator

So, I'd guessed right! :)
Thanks a lot for your swift reply. You rock! :thumbup




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN