As for RAM, the match is good, my 512MB are almost fully used...
Powerbook G4/667, OSX.4.6, 512MB RAM
Claude-Albert Berseth <void@nospam.com> wrote:
As for RAM, the match is good, my 512MB are almost fully used...
Powerbook G4/667, OSX.4.6, 512MB RAM
Before all the others start explaining things: Get more RAM!
IMHO, no Mac should hve less than 768, preferably 1GB or more. It will
do wonders to performance and response. VM is slo-o-o-ow in comparison
with real RAM, no matter what you do, and the less the Mac needs to
utilize it (i.e., swap in and out) the better.
I have a problem understanding how virtual memory is counted :
So what does the Virtual Memory mean ? Is it the maximum size that an application could claim ? Or is this VM heavily compressed ?
Sure enough, Jon. I ordered 1GB a few days ago, I can't wait to see
the improvement !!!
I think 512MB was ok (sort of) up to X.1 or X.2 but the system has
become very heavy since then ...
Hi all,
I have a problem understanding how virtual memory is counted :
- The activity monitor shows 4.36GB of Virtual memory
- /private/var/vm/swapfile* files have a total size of 512MB
I verified that these are really the active swapfiles.
There are 59 processes, a dozen of which are displayed as "active".
So what does the Virtual Memory mean ? Is it the maximum size that an application could claim ? Or is this VM heavily compressed ?
As for RAM, the match is good, my 512MB are almost fully used...
Powerbook G4/667, OSX.4.6, 512MB RAM
Thanks in advance for your ideas...
Claude-Albert
Hans was very close, except a page is 4K, not 1K.
My preferred way of figuring out if you are suffering from too
little memory is to launch Applications -> Utilities -> Terminal
then run the program 'vm_stat 60' and watch the last column
(pageout) ignoring the first row after the descriptive header line.
In article <nospam.News.Bob-A49663.20103908042006@news.verizon.net>, Bob Harris <nospam.News.Bob@remove.Smith-Harris.us> wrote:
Hans was very close, except a page is 4K, not 1K.
How do you check this virtual memory page size via some UNIX command?
My preferred way of figuring out if you are suffering from too
little memory is to launch Applications -> Utilities -> Terminal
then run the program 'vm_stat 60' and watch the last column
(pageout) ignoring the first row after the descriptive header line.
It seems that one has to install the developer package, for 'vm_stat' to
be present. Using 'vm_stat' otherwise gives a convenient way to check it.
In order to install the developer package, go to the Apple developer site
and download latest Xcode, and install it directly; do not do install the developer package from the install disks, as the updating is buggy.
In article <nospam.News.Bob-A49663.20103908042006@news.verizon.net>, Bob Harris <nospam.News.Bob@remove.Smith-Harris.us> wrote:
Hans was very close, except a page is 4K, not 1K.
How do you check this virtual memory page size via some UNIX command?
My preferred way of figuring out if you are suffering from too
little memory is to launch Applications -> Utilities -> Terminal
then run the program 'vm_stat 60' and watch the last column
(pageout) ignoring the first row after the descriptive header line.
It seems that one has to install the developer package, for 'vm_stat' to
be present. Using 'vm_stat' otherwise gives a convenient way to check it.
In order to install the developer package, go to the Apple developer site
and download latest Xcode, and install it directly; do not do install the developer package from the install disks, as the updating is buggy.
But I did a little digging in the man pages, and the "man vmmap"
command (never used it personally), says pages are displayed in
"4KB pages". While it does not say flat out that a VM page is 4K,
it is at least reinforcement for it.
Also 4K is a very common VM page size in many operating systems.
Best I can do at the moment.
Bob Harris
Hans Aberg wrote:
In article <nospam.News.Bob-A49663.20103908042006@news.verizon.net>, Bob Harris <nospam.News.Bob@remove.Smith-Harris.us> wrote:
Hans was very close, except a page is 4K, not 1K.
How do you check this virtual memory page size via some UNIX command?
My preferred way of figuring out if you are suffering from too
little memory is to launch Applications -> Utilities -> Terminal
then run the program 'vm_stat 60' and watch the last column
(pageout) ignoring the first row after the descriptive header line.
It seems that one has to install the developer package, for 'vm_stat' to
be present. Using 'vm_stat' otherwise gives a convenient way to check it. In order to install the developer package, go to the Apple developer site and download latest Xcode, and install it directly; do not do install the developer package from the install disks, as the updating is buggy.
Ok, vm_stat works and I have started to watch the pageouts. It will take
me some time to get a good feeling. For the moment I see a very low
level of pageouts, bursts of pageins when bringing an app to the front
or starting a new command - as expected.
As for my initial question, I still don't understand the meaning of the "Virtual Memory" size for each application. It ranges from 20MB to 200MB
for most of my apps, with Firefox having 479MB and the kernel 652MB.
Note that these sizes seem to be dynamic, for example adding a tab and opening another web page in Firefox makes its VM size increase.
But...is Firefox really using up 479MB (RAM or paged out, I don't care)
??? Or is this just an allocation in case Firefox would need that space ?
In article <281e1$4438e6ba$5448a851$6667@news.hispeed.ch>,
Claude-Albert Berseth <void@nospam.com> wrote:
Hans Aberg wrote:
In article <nospam.News.Bob-A49663.20103908042006@news.verizon.net>, Bob >>> Harris <nospam.News.Bob@remove.Smith-Harris.us> wrote:
Hans was very close, except a page is 4K, not 1K.
How do you check this virtual memory page size via some UNIX command?
My preferred way of figuring out if you are suffering from too
little memory is to launch Applications -> Utilities -> Terminal
then run the program 'vm_stat 60' and watch the last column
(pageout) ignoring the first row after the descriptive header line.
It seems that one has to install the developer package, for 'vm_stat' to >>> be present. Using 'vm_stat' otherwise gives a convenient way to check it. >>> In order to install the developer package, go to the Apple developer site >>> and download latest Xcode, and install it directly; do not do install the >>> developer package from the install disks, as the updating is buggy.
Ok, vm_stat works and I have started to watch the pageouts. It will take
me some time to get a good feeling. For the moment I see a very low
level of pageouts, bursts of pageins when bringing an app to the front
or starting a new command - as expected.
As for my initial question, I still don't understand the meaning of the
"Virtual Memory" size for each application. It ranges from 20MB to 200MB
for most of my apps, with Firefox having 479MB and the kernel 652MB.
Note that these sizes seem to be dynamic, for example adding a tab and
opening another web page in Firefox makes its VM size increase.
But...is Firefox really using up 479MB (RAM or paged out, I don't care)
??? Or is this just an allocation in case Firefox would need that space ?
The operating system creates a Virtual Memory map for an
application when it is created based on the size of the
executable, the size of the initialized data (text strings,
constants, variables initialized by the compiler, etc...), and the
declared uninitialized memory needs of the program (both data and
stack space). This is also done for any run-time libraries the
program may have been linked against. This results in a Virtual
Map of the potential memory needs for the appliations, BUT NOT ONE
BIT OF MEMORY HAS BEEN GIVEN TO THE APPLICATION YET. All of this
is just book keeping by the OS. Like drawing up the plans for a
house before you build it.
This is the initial Virtual Memory for an application and it will
vary depending on how much code, initialized data, declared
uninitialized data, and libraries the application programs uses.
Small programs use less VM up front than huge mega programs.
Now as the applications is launched code and data are paged into
memory from the application file and the run-time libraries. Real
memory is allocated to the applications at this time, but only for
areas that used. Until they are used, they sit out on disk
waiting.
In addition, the program will start to use the uninitialized
memory areas it declared during compile time, and real memory will
be allocated as the virtual address space is used.
An application may dynamically allocation additional memory as it
run (for example Firefox may dynamically allocate cache to store
web pages and images in). This dynamic allocation causes the
operating system to allocate additional virtual memory space to
the application, so the applications VM size can grow.
This dynamic allocation is like building an addition onto your
house. It was not in the original plans, but you do it anyway. A
garage, back deck, room over the garage, family room, sun room,
wrap around porch, tool shed, swimming pool, flower garden,
vegetable garden, etc...
Applications programs can dynamically load additional code, that
were not there to begin with. Plugins, extensions, additional
libraries. For example, Firefox may load a plugin or extension to
run Flash, or Java. But until it downloads a page that needs
those services it will not bother. But each of these plugins,
extensions, libraries will require additional Virtual Memory
address space, so the applications VM size will grow some more.
Finally, some applications have memory leaks. Those of us in
programming don't like to air our dirty laundry in public, but it
does happen. In this case an application with a memory leak will dynamically allocate memory, and sometimes forget to free it for
reuse. As time goes by it forgets more and more dynamica memory,
and grows to a very large VM size. Quiting such an application
will free up all the VM.
Now having mentioned Memory Leaks, I am _NOT_ saying anything
about Firefox. For the most part Firefox is just using more VM
because over time it caches more web pages and images, you open
more tabs, you eventually load a page with java on it, you
eventually load a page with Flash, you get around to loading a
page with Quicktime needs (video or audio), etc... and Firefox
dynamically allocates more memory.
OK, now if you have lots and lots of memory, then as your
application uses the VM, real memory is allocated to it, and
everything is great.
But generally more real memory will be needed than physically
exists, and the operating system will now start to page.
First it will look for pages that are inactive. The OS keeps tabs
on the usage of Real memory, and if an application loaded a
section of code or data awhile ago, but has not used it recently,
that memory will be marked inactive. Inactive pages of Real
memory that are read-only and have original copies on disk (like
application or library code), are easy cheap sources of additional
memory, as the OS just needs to mark the VM map to say the
application program needs to get this from disk if it needs it
again, and then just give the memory to the task that is in need.
This is one of the ways you will see an application program pagein
data when you switch to it. It was idle while you were away,
pages became inactive, eventually the inactive pages were needed
for something else, so the read-only pages were released for other
needs.
Inactive memory that has been modified, need to be paged out
before the memory can be used. Even if there is an original on
disk, you do not use that as the modified values are not the
original values, so space in the page files is allocated, and
these pages are paged out. (if the page was paged out before,
then it already has a space in the page file, and will just be
paged back to that space).
These paged out pages are also a source of pagein activity, when
you switch to an app. The big difference is that you paid the
price of paging it out and paging it in.
Also when you start paging out, there is a very good likely hood
that you may soon reach the point when you application is paging
against itself. That is to say the application is so big and
doing so much work on so much data, that it is not longer getting
pages from other idle applications, it needs to get pages from
itself. Of course the application doesn't know that, the OS makes
decisions and if there is no other memory to free, it will start
to take if from active page of the application itself. This is
generally the case when you are seeing constant paging. It can
also happen if you have several active applications running
concurrently, like playing iTunes while doing software update,
while surfing the web, while downloading email, while Photoshop
runs a complex filter, while using iChat video session with your
Mom, etc... Then everyone is stealing pages from everyone else.
So did I loose you on the 2nd paragraph? Or is everything "Clear
as Mug"?
Bob Harris
In article <281e1$4438e6ba$5448a851$6667@news.hispeed.ch>,[snip]
Claude-Albert Berseth <void@nospam.com> wrote:
Hans Aberg wrote:
In article <nospam.News.Bob-A49663.20103908042006@news.verizon.net>, Bob Harris <nospam.News.Bob@remove.Smith-Harris.us> wrote:
So did I loose you on the 2nd paragraph? Or is everything "Clear
as Mug"?
Sure enough, Jon. I ordered 1GB a few days ago, I can't wait to see
the improvement !!!
I think 512MB was ok (sort of) up to X.1 or X.2 but the system has
become very heavy since then ...
So did I loose you on the 2nd paragraph? Or is everything "Clear
as Mug"?
Bob Harris
On 2006-04-08 21:25:32 +0300, Claude-Albert Berseth <void@nospam.com> said:
Sure enough, Jon. I ordered 1GB a few days ago, I can't wait to see
the improvement !!!
I think 512MB was ok (sort of) up to X.1 or X.2 but the system has
become very heavy since then ...
Yes, Apple never "wastes" additional RAM, even if it is not used, it
will be used for all sorts of "cache" stuff.
I use 1.5 GB for years and had excellent performance as result of it.
BTW, you may see "64mb" or "128mb" of "swap" still used after having
those RAMs installed. It is part of "OS Strategy". Common in all modern OS'es.
In fact I will move to 4 gb with my G5 dual 2300 (when I finally buy),
they will get used anyway :)
Ilgaz
Finally, some applications have memory leaks. Those of us in
programming don't like to air our dirty laundry in public, but it
does happen. In this case an application with a memory leak will dynamically allocate memory, and sometimes forget to free it for
reuse. As time goes by it forgets more and more dynamica memory,
and grows to a very large VM size. Quiting such an application
will free up all the VM.
When executing the command vm_stat, here is what I get (3 first lines) :
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 70%)
The operating system creates a Virtual Memory map for an
application when it is created based on the size of the
executable, the size of the initialized data (text strings,
constants, variables initialized by the compiler, etc...), and the
declared uninitialized memory needs of the program (both data and
stack space). This is also done for any run-time libraries the
program may have been linked against. This results in a Virtual
Map of the potential memory needs for the appliations, BUT NOT ONE
BIT OF MEMORY HAS BEEN GIVEN TO THE APPLICATION YET. All of this
is just book keeping by the OS. Like drawing up the plans for a
house before you build it.
This is the initial Virtual Memory for an application and it will
vary depending on how much code, initialized data, declared
uninitialized data, and libraries the application programs uses.
Small programs use less VM up front than huge mega programs.
Now as the applications is launched code and data are paged into
memory from the application file and the run-time libraries. Real
memory is allocated to the applications at this time, but only for
areas that used. Until they are used, they sit out on disk
waiting.
In addition, the program will start to use the uninitialized
memory areas it declared during compile time, and real memory will
be allocated as the virtual address space is used.
An application may dynamically allocation additional memory as it
run (for example Firefox may dynamically allocate cache to store
web pages and images in). This dynamic allocation causes the
operating system to allocate additional virtual memory space to
the application, so the applications VM size can grow.
This dynamic allocation is like building an addition onto your
house. It was not in the original plans, but you do it anyway. A
garage, back deck, room over the garage, family room, sun room,
wrap around porch, tool shed, swimming pool, flower garden,
vegetable garden, etc...
Applications programs can dynamically load additional code, that
were not there to begin with. Plugins, extensions, additional
libraries. For example, Firefox may load a plugin or extension to
run Flash, or Java. But until it downloads a page that needs
those services it will not bother. But each of these plugins,
extensions, libraries will require additional Virtual Memory
address space, so the applications VM size will grow some more.
Finally, some applications have memory leaks. Those of us in
programming don't like to air our dirty laundry in public, but it
does happen. In this case an application with a memory leak will dynamically allocate memory, and sometimes forget to free it for
reuse. As time goes by it forgets more and more dynamica memory,
and grows to a very large VM size. Quiting such an application
will free up all the VM.
Now having mentioned Memory Leaks, I am _NOT_ saying anything
about Firefox. For the most part Firefox is just using more VM
because over time it caches more web pages and images, you open
more tabs, you eventually load a page with java on it, you
eventually load a page with Flash, you get around to loading a
page with Quicktime needs (video or audio), etc... and Firefox
dynamically allocates more memory.
OK, now if you have lots and lots of memory, then as your
application uses the VM, real memory is allocated to it, and
everything is great.
But generally more real memory will be needed than physically
exists, and the operating system will now start to page.
First it will look for pages that are inactive. The OS keeps tabs
on the usage of Real memory, and if an application loaded a
section of code or data awhile ago, but has not used it recently,
that memory will be marked inactive. Inactive pages of Real
memory that are read-only and have original copies on disk (like
application or library code), are easy cheap sources of additional
memory, as the OS just needs to mark the VM map to say the
application program needs to get this from disk if it needs it
again, and then just give the memory to the task that is in need.
This is one of the ways you will see an application program pagein
data when you switch to it. It was idle while you were away,
pages became inactive, eventually the inactive pages were needed
for something else, so the read-only pages were released for other
needs.
Inactive memory that has been modified, need to be paged out
before the memory can be used. Even if there is an original on
disk, you do not use that as the modified values are not the
original values, so space in the page files is allocated, and
these pages are paged out. (if the page was paged out before,
then it already has a space in the page file, and will just be
paged back to that space).
These paged out pages are also a source of pagein activity, when
you switch to an app. The big difference is that you paid the
price of paging it out and paging it in.
Also when you start paging out, there is a very good likely hood
that you may soon reach the point when you application is paging
against itself. That is to say the application is so big and
doing so much work on so much data, that it is not longer getting
pages from other idle applications, it needs to get pages from
itself. Of course the application doesn't know that, the OS makes
decisions and if there is no other memory to free, it will start
to take if from active page of the application itself. This is
generally the case when you are seeing constant paging. It can
also happen if you have several active applications running
concurrently, like playing iTunes while doing software update,
while surfing the web, while downloading email, while Photoshop
runs a complex filter, while using iChat video session with your
Mom, etc... Then everyone is stealing pages from everyone else.
In article <5ae8c$44391fcc$5448a851$20117@news.hispeed.ch>, Claude-Albert Berseth <void@nospam.com> wrote:
When executing the command vm_stat, here is what I get (3 first lines) :
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 70%)
Thanks. I should perhaps have run 'vm_stat' before asking, but know
everyone knows, which is good. :-)
At boot time, OS X allocates 64 MB of pagefile space. If you have oodles
of RAM this may be sufficient until your next boot (where oodles varies
with the applications you run and size of files you may be reading into memory).
When the first pagefile is full, OS X allocates another 64 MB pagefile,
and now has a total of 128 MB of pagefile space to work with. The
algorithm used for extra pagefiles is to double the total pagefile space
each time an extra one is required.
Please note that this algorithm may well be subject to change in future versions of OS X.
The only other thing to add is that once a pagefile is created, it stays until the next reboot.
Paul Sture <paul.sture.nospam@hispeed.ch> wrote:
The only other thing to add is that once a pagefile is created, it stays >>until the next reboot.
Not always. I've found that if you do something like log out, and your virtual memory allocation happens to be just right, the system can
usually delete the highest numbered (and largest) swapfiles. Quitting a
lot of applications may be sufficient in some cases, but logging out
ensures that nearly everything you run normally has quit (including
Finder and the Dock, plus background things like WindowServer, which may
have recently allocated memory.
I was also aware of this "automatic deletion where possible" in Panther (10.3), but not sure about Jaguar (10.2). It definitely didn't get rid
of excess swapfiles in 10.0 or 10.1 unless you restarted.
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 790 |
Nodes: | 20 (0 / 20) |
Uptime: | 40:31:26 |
Calls: | 12,115 |
Calls today: | 5 |
Files: | 5,294 |
D/L today: |
72 files (9,959K bytes) |
Messages: | 564,933 |