PDA

View Full Version : Memory-Limit


pkehoe
06-13-2003, 03:17 PM
I'm seeing a strange problem. I recently upgraded my PC
(Compaq N800W) to have 2 GB of RAM. Once I upgraded,
I decided to load some larger files. I loaded one file and
checked my memory-limit; it said that I was using about
300 MB. I loaded a larger file to that session and the
memory-limit jumped up to about 1 GB. I loaded yet
another file and checked the memory-limit and to my
surprise it was unchanged-it still said about 1 GB. (I checked
and the file really was loaded.) I had loaded this file by
itself and it used about 250 MB.

I continued to load more files, seeing how close I could come to
the memory-limit that I had set (1900 MB). I loaded several
more smaller files, each time checking the memory-limit. I got
to less than 1.2 GB when I received the "not enough memory"
message.

At first I thought that it was a bug in how the memory-check
calculated how much memory was being used. But then I
turned on the Task Manager and checked to see how much
memory Windows said it was using and found that it matched
pretty close.

So now I don't know what is going on. I do know that I can't
trust the memory-check results, especially when I get over 1 GB.

clausb
06-14-2003, 01:50 AM
Pete,

you say things like "I loaded one file and
checked my memory-limit; it said that I was using about 300 MB." What exactly do you mean by this? How do you measure the "memory-limit"? I guess most of the confusion will clear up once we can determine how you measure the memory consumption and how this relates to actual memory management and resources.

In general, the memory-limit command should no longer be used. OSDM automatically sets it internally now, so there is no need to adapt it anymore when you upgrade RAM or page file size.

Having 2 GB of RAM in a machine does not necessarily mean you can use all of that for data. First, the page file must match the RAM. Second, while Windows assigns 2 GB of virtual address space to applications (bu default), it populates this address space not only with the application's data, but also with the application code including any system DLLs it uses (and DLLs used by those DLLs and so on), and also satisfies memory requests by those DLLs from the same address space. As a result, you will never get the full virtual address space for your data.

How much you actually get out of your system depends on the local configuration. As a rule of thumb, the more modules you load, the more drivers and system components are active and installed, the more memory will be consumed by them. Just recently, we had a case where one 3 GB system would report less than 2400 MB of available memory (according to uic-show-memory-usage), while another reports more than 2900 MB...

Claus

pkehoe
06-16-2003, 08:53 AM
Claus,

> you say things like "I loaded one file and
> checked my memory-limit; it said that I was using about 300
> MB." What exactly do you mean by this? How do you measure > the "memory-limit"?

I used uic-show-memory-usage which reports memory used and
the memory-limit. I would use this command to see how much
memory I was using compared to what my limit was. In one case
it said that my limit was 1900 and I was only using 1100; but
then OSDM said that I did not have enough memory to load a
file which previously had only used 300 MB.

> In general, the memory-limit command should no longer be
> used. OSDM automatically sets it internally now, so there is no
> need to adapt it anymore when you upgrade RAM or page file
> size.

> How much you actually get out of your system depends on the > local configuration. As a rule of thumb, the more modules you
> load, the more drivers and system components are active and
> installed, the more memory will be consumed by them. Just
> recently, we had a case where one 3 GB system would report
> less than 2400 MB of available memory (according to uic-show-
> memory-usage), while another reports more than 2900 MB...

I have a 2 GB system, but OSDM sets my memory-limit to 1500 MB.
Does that mean I have 500 MB of drivers and other components?
If so, how do I get rid of them? Or, what would happen if I
manually set the limit to 1900 MB?

clausb
06-16-2003, 09:09 AM
Pete,

if OSDM sets the memory limit to 1500 (and if you don't have any explicit memory-limit commands in customization files somewhere, such as in pesd_customize), then this means that during startup it was detected that not more than this amount of virtual memory is available to the application. This can be due to system components loaded into the address space of the application, or it could be a virtual memory configuration problem (in particular, look at the page file configuration).

Getting rid of system components which soak up address space is, in fact, a tricky business. The first step is to find out what kind of components are mapped into the process address space. This requires some skill and the right tools. One such tool is the "Process Explorer" which is downloadable from http://www.sysinternals.com . For any running process, it will tell you which DLLs are loaded into its address space. However, DLLs are not the only thing which can block address space.

OSDM 2002+ and later contain some internal debug functionality which generates an internal memory map. Here's how you generate this information:


Start up OSDM.
In the user input line, enter (context-debug "c:/temp/memory.log")(f2::memory-map)
Now load large models until you run out of memory.
Enter (f2::memory-map) in the user input line
Close OSDM.
Send the memory.log file to CoCreate support (or to me, in this case) for closer analysis


Sometimes, the analysis of the memory map file reveals ways to tune the system, but there's no guarantee.

Another easy way to get more out of your address space is to load only the
most urgently needed modules during OSDM startup. Each module which is loaded consumes additional memory, of course!

Hope this helps,

Claus