[comp.windows.ms] Windows Virtual Memory???

mcjilton@handel.CS.ColoState.Edu (charles mar mcjilton) (09/05/90)

Windows 3.00 is supposed to have virtual memory, but when we compile our
program using MSC Meduim model, we only have 64K to put all of our data, as
well as our stack and heap.  We were thinking of going to the Large model,
but were told that would make the program fixed in memory (due to FAR pointers)
and it would not be able to swap any part of the program out (including the
library functions, etc...  That doesn't sound like virtual mamory to me.

Anyone know what we can do?

<Using a friends account>
Sean

spolsky-joel@cs.yale.edu (Joel Spolsky) (09/05/90)

In article <8698@ccncsu.ColoState.EDU> mcjilton@handel.UUCP (charles mar mcjilton) writes:
>Windows 3.00 is supposed to have virtual memory, but when we compile our
>program using MSC Meduim model, we only have 64K to put all of our data, as
>well as our stack and heap.  We were thinking of going to the Large model,
>but were told that would make the program fixed in memory (due to FAR pointers)
>and it would not be able to swap any part of the program out (including the
>library functions, etc...  That doesn't sound like virtual mamory to me.

First of all, I assume you have a 386, because if you don't, you don't
have virtual memory anyway. Now if you are running in 386 protected
mode, you can either go to large model and not worry about stuff being
fixed in memory (it won't, in enhanced mode) or you could do what the
book recommends and use GlobalAlloc to allocate yourself as much
global memory as you want.

This kind of stuff is really basic Windows stuff; please do take a few
minutes to look over the manuals or Petzold before posting stuff like
this...

Joel Spolsky
spolsky@cs.yale.edu                                        Talk Hard.

mcjilton@handel.CS.ColoState.Edu (charles mar mcjilton) (09/07/90)

In article <26000@cs.yale.edu> spolsky-joel@cs.yale.edu (Joel Spolsky) writes:
>book recommends and use GlobalAlloc to allocate yourself as much
>global memory as you want.
>
>This kind of stuff is really basic Windows stuff; please do take a few
>minutes to look over the manuals or Petzold before posting stuff like
>this...

Hmmmm.  I guess 5 of us reading Petzold, and developing in windows for 10 months
now isn't good enough for you?  We do GlobalAlloc() the stuff we can, but
when you have a 400K executable, the stack just tends to fill up.  You
weren't telling us to GlobalAlloc() the stack and heap, were you?  I
don't remember Petzold talking about this.  And since Petzold;s book is for
2.11, he wouldn't be telling us to use large model.

Indeed, if you had looked over Petzold, you would have seen where he STRONGLY
reccomends AGAINST using large model.

<Using same friends account>
Sean