Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 10-24-2003, 09:59 PM   #1
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
/var/vm swapfiles have changed size

Greetings,

As many of us are aware, swap files in Jaguar were always 80000000 bytes (~76mb), I see that they are now dynamically sized. Is anyone else seeing this?

Code:
yellow% lf
total 524288
drwxr-xr-x   5 root  wheel        170 24 Oct 20:24 ./
drwxr-xr-x  21 root  wheel        714 24 Oct 19:21 ../
-rw------T   1 root  wheel   67108864 24 Oct 18:04 swapfile0
-rw------T   1 root  wheel   67108864 24 Oct 19:16 swapfile1
-rw------T   1 root  wheel  134217728 24 Oct 20:24 swapfile2
yellow is offline   Reply With Quote
Old 10-24-2003, 10:34 PM   #2
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
yep. new and improved, in increments of 64MB
mervTormel is offline   Reply With Quote
Old 10-24-2003, 11:14 PM   #3
petey
All Star
 
Join Date: Feb 2002
Location: peteyville
Posts: 794
Why make a 128MB Swapfile2, rather than a 64MB Swapfile2 and a 64MB Swapfile3?

bizarre.
petey is offline   Reply With Quote
Old 10-24-2003, 11:17 PM   #4
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
And what's with the app_profile in there now?

drwx--x--x 8 root wheel 272 24 Oct 22:15 app_profile/
yellow is offline   Reply With Quote
Old 10-24-2003, 11:19 PM   #5
petey
All Star
 
Join Date: Feb 2002
Location: peteyville
Posts: 794
Quote:
Originally posted by yellow

And what's with the app_profile in there now?

it's there in Jaguar.
petey is offline   Reply With Quote
Old 10-24-2003, 11:20 PM   #6
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
Really? Weird.. I've never seen it before. Oh well.
yellow is offline   Reply With Quote
Old 10-24-2003, 11:20 PM   #7
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Quote:
Originally posted by petey
Why make a 128MB Swapfile2, rather than a 64MB Swapfile2 and a 64MB Swapfile3?

bizarre.

usage metrics. if large number of pageouts, then make a larger file. it's all about predictive behaviors.
mervTormel is offline   Reply With Quote
Old 10-28-2003, 05:18 AM   #8
ceffe
Prospect
 
Join Date: Sep 2003
Location: Sweden
Posts: 2
Question Are they increasing in number?

Could I ask a related question. My system (1GB RAM) in Jaguar often used only one swapfile. Now I seem to have three or more. Is this usual behaviour in Panther?

Yes, I do have Fast user switching on now and at least two accounts logged in.

The reason I'm asking is that I'm concerned wether more swapfiles instead of normal panther behaviour is caused by memory leakage (I do not really know what that is, but understand that it is not desirable.)

Thanks in advance.

/ceffe
ceffe is offline   Reply With Quote
Old 10-29-2003, 09:54 PM   #9
EatingPie
Triple-A Player
 
Join Date: Jan 2002
Posts: 63
I'm not entirely sure about the dynamics of virtual memory. But at the very least I can tell you it's hard to say if your swap usage is indicative of a memory leak. I know this doesn't answer your question, but purely as a semi-educated guess, I'd say it's unlikely.

If you check Memory Usage in Activity Monitor, you will see that every Mac OS X process puts a fairly hefty load on the VM system. Here's a Sample...

Eudora 213 MB Virtual Memory
Safari 193 MB VM
Finder 172 MB VM

System UI Server 142 MB VM
Activity Monitry 163 MB VM

And last but not least...

WindowServer 1.13 GB VM

Wowza!!

And I thought I was stylin' with 512 MB of RAM!! D'oh!

Anyway with two users running, you can double all of those I listed (assuming your other user likes Eudora and Safari!). So that's probably the issue right there.

As an aside lemme just tell you what a memory leak is. Programs must allocate memory to use it. When they're done with it, they need to de-allocate it so others can use it. Sometimes programs forget to de-allocate. That problem gets magnified when that forgetful piece of code gets run a whole bunch of times. So it's basically like unused memory leaking away from the system.

The main way to tell is if you have a particular program growing (sometimes very slowly) out of control.

Anyway, with the numbers above, I'm sure your VM is behaving correctly.

-Pie
__________________
Story Bytes - Very Short Fiction
http://www.storybytes.com

Last edited by EatingPie; 10-29-2003 at 10:27 PM.
EatingPie is offline   Reply With Quote
Old 10-30-2003, 07:05 AM   #10
macmath
MVP
 
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,497
Is there any pattern to the size of the next swapfile created? Mine start out as yellow's do; the first two are the same, and then they began to double in size (usage went up too, of course, so this is in no means definitive.)

Code:
[Panther:~] us% ls -al /var/vm/
total 1048576
drwxr-xr-x   6 root  wheel        204 29 Oct 23:37 .
drwxr-xr-x  19 root  wheel        646 29 Oct 06:25 ..
-rw------T   1 root  wheel   67108864 29 Oct 06:26 swapfile0
-rw------T   1 root  wheel   67108864 29 Oct 13:27 swapfile1
-rw------T   1 root  wheel  134217728 29 Oct 18:57 swapfile2
-rw------T   1 root  wheel  268435456 29 Oct 19:44 swapfile3
macmath is offline   Reply With Quote
Old 10-30-2003, 07:25 AM   #11
Craig R. Arko
Site Admin
 
Join Date: Dec 2001
Location: Minneapolis, MN
Posts: 3,988
I see the same as MacMath. So, anybody see swapfile4 yet? 512MB?

You can pretty well guaranty Fast User Switching will eat a ton of memory, if they're all running apps at once.
Craig R. Arko is offline   Reply With Quote
Old 10-30-2003, 07:35 AM   #12
macmath
MVP
 
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,497
One pattern would be that the size of the next swapfile is the sum of the sizes of all the preceding swapfiles. That scheme is consistent with the fact that the first two are the same size. The size of the next swapfile would still follow the pattern of being double the size of the previous one.

I claim no computer significance to the above pattern, just fulfilling the 'math' part of macmath.
macmath is offline   Reply With Quote
Old 10-30-2003, 07:42 AM   #13
Craig R. Arko
Site Admin
 
Join Date: Dec 2001
Location: Minneapolis, MN
Posts: 3,988
Ahhh, Leonardo Pisano strikes again...
Craig R. Arko is offline   Reply With Quote
Old 10-30-2003, 12:47 PM   #14
macmath
MVP
 
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,497
Confirmed (that SizeOfSwapfile4 = 2*SizeOfSwapfile3= Sum of the sizes of all previous swapfiles)!

Code:
[Panther:~] haar% ls -al /var/vm
total 1048576
drwxr-xr-x    7 root     wheel         238 Oct 30 11:44 .
drwxr-xr-x   19 root     wheel         646 Oct 30 07:47 ..
-rw------T    1 root     wheel    67108864 Oct 30 07:47 swapfile0
-rw------T    1 root     wheel    67108864 Oct 30 08:34 swapfile1
-rw------T    1 root     wheel    134217728 Oct 30 08:35 swapfile2
-rw------T    1 root     wheel    268435456 Oct 30 10:58 swapfile3
-rw------T    1 root     wheel    536870912 Oct 30 11:44 swapfile4
I hit it pretty hard to get swapfile4, so I doubt I get a swapfile5 without trying again. But it looks like from here I lose gigabytes at a time. ...talk about snowballing.

[Edited to add: I used to kind of scoff at running an application which warns you of available free space (as being frivolous), but given the above, I now think they have their place. Either that, or it is time for some people to buy more memory/bigger drive. I still have 24 GB free so I'm not worried about these yet.]

Last edited by macmath; 10-30-2003 at 01:10 PM.
macmath is offline   Reply With Quote
Old 10-30-2003, 05:54 PM   #15
macmath
MVP
 
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,497
Hey! It gave some swap space back.

I have not logged out or restarted all day. I just quit some of the many applications I had to open and have doing something so that I could get that 5th swapfile. Note:

Code:
drwxr-xr-x    6 root     wheel         204 Oct 30 16:50 .
drwxr-xr-x   19 root     wheel         646 Oct 30 07:47 ..
-rw------T    1 root     wheel    67108864 Oct 30 07:47 swapfile0
-rw------T    1 root     wheel    67108864 Oct 30 08:34 swapfile1
-rw------T    1 root     wheel    134217728 Oct 30 08:35 swapfile2
-rw------T    1 root     wheel    268435456 Oct 30 10:58 swapfile3
The last an biggest swapfile is gone. I've never had/noticed them being given back before without a restart.
macmath is offline   Reply With Quote
Old 10-30-2003, 05:56 PM   #16
macmath
MVP
 
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,497
Wait!

After posting I noted that it surrendered some more:

Code:
[Panther:~] haar% ls -al /var/vm
total 262144
drwxr-xr-x    5 root     wheel         170 Oct 30 16:52 .
drwxr-xr-x   19 root     wheel         646 Oct 30 07:47 ..
-rw------T    1 root     wheel    67108864 Oct 30 07:47 swapfile0
-rw------T    1 root     wheel    67108864 Oct 30 08:34 swapfile1
-rw------T    1 root     wheel    134217728 Oct 30 08:35 swapfile2
[Panther:~] haar%
macmath is offline   Reply With Quote
Old 10-30-2003, 05:59 PM   #17
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
dynamic working set trimming! finally! they put the VMS code back in
mervTormel is offline   Reply With Quote
Old 10-30-2003, 06:01 PM   #18
Craig R. Arko
Site Admin
 
Join Date: Dec 2001
Location: Minneapolis, MN
Posts: 3,988
That settles it. Worth the $129.


oh kernel, my kernel...
Craig R. Arko is offline   Reply With Quote
Old 10-30-2003, 06:36 PM   #19
petey
All Star
 
Join Date: Feb 2002
Location: peteyville
Posts: 794
This behavior exists under Jaguar.

VM may possibly be more robust about returning swap space under Panther, but I'm running Jaguar and about an hour ago I quit Safari for the first time in days and 2 swapfiles disappeared.
petey is offline   Reply With Quote
Old 10-30-2003, 07:01 PM   #20
EatingPie
Triple-A Player
 
Join Date: Jan 2002
Posts: 63
This thread leads me to ask another question...

I created a separate Swap partition that is 5.1GB. With 512MB RAM, I'm wondering if this is big enough...

What say you...?? And how 'bout with 1GB RAM??

-Pie
__________________
Story Bytes - Very Short Fiction
http://www.storybytes.com
EatingPie is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.