| View previous topic :: View next topic |
| Author |
Message |
sundialsvc4 Guru

Joined: 10 Nov 2005 Posts: 433
|
Posted: Fri Apr 24, 2009 12:19 pm Post subject: |
|
|
That may be why systems like Windows and OS/X swap to a disk-file ... which you can also do in Linux, I believe.
I like to give the system somewhere to stuff data, but when RAM sizes are measured in gigabytes it really does become less of a point.
I would say... it's reasonable to turn-off swap if you have lots of RAM. You can always turn it back on again. The system won't use it anyway, if it doesn't need it. I'd just avoid having a fixed allocation of disk-space, e.g. a partition, for such a (now highly unlikely) purpose anymore. |
|
| Back to top |
|
 |
atrus123 Guru


Joined: 06 Jul 2005 Posts: 339 Location: Annapolis, MD
|
Posted: Fri Apr 24, 2009 1:47 pm Post subject: |
|
|
I've recently been working with some huge files on my laptop w/ 2GB ram.
Basically I have a gigantic image, built in the Gimp and imported into Inkscape for some additional modifications. Then (because Inkscape annoyingly doesn't support compressed PDFs), I export the finished image as PNG and use Imagemagick to build the compressed PDF.
Gimp uses doesn't use swap, but Inkscape and Imagemagick do. If I hadn't given myself 1GB swap to work with, I'd be screwed.
I see no reason to ever shut it off. My system never ever uses swap unless I start doing big graphics work. I don't need to manage it at all. _________________ "I cannot support a movement that exploded spending and borrowing and blames its successor for the debt."
-Andrew Sullivan |
|
| Back to top |
|
 |
bunder Bodhisattva


Joined: 10 Apr 2004 Posts: 5213
|
Posted: Fri Apr 24, 2009 1:52 pm Post subject: |
|
|
i've almost maxed out the swap on my laptop quite a few times editing images in gimp. it's a real pain too, because the PSD's are supposedly big (8mb is big?)... but when i get them open and make a few changes i get really really close to OOM-ing. never had that problem doing video editing back in the day...
edit: doesn't help that X and firefox take up most of my ram after a few hours.  _________________ goodbye fgo. it was nice knowing you. |
|
| Back to top |
|
 |
i92guboj Moderator


Joined: 30 Nov 2004 Posts: 9464 Location: Córdoba (Spain)
|
Posted: Fri Apr 24, 2009 2:05 pm Post subject: |
|
|
| bunder wrote: | | i've almost maxed out the swap on my laptop quite a few times editing images in gimp. it's a real pain too, because the PSD's are supposedly big (8mb is big?) |
I know nothing about the psd internal format. But I guess they use some kind of compression algorithm. When dealing with images you don't have to look at the size of the psd, but at the size of the bitmaps once they are uncompressed on your ram, which is how they are when you open the file. And that size will be width*height*bpp plus other info that the file might contain like alpha channels and such. So, an image of 1024x768x24 will always take 18MB, even if the jpg container only takes 35k on your disk.
So, if the psd file takes 8mb in your hd it's very likely that it can take 2, 3, 5, 20 or 200 times more space in your ram. It all depends on the contents of the bitmaps that the file holds inside. Try saving it as an uncompressed bmp (not rle) to get an idea of the real size of the contents (and even then it would be only an approximation because in psd you can have lots of layers, while in bmp you have only one bitmap). _________________ Gentoo Handbook | My website |
|
| Back to top |
|
 |
durian Guru


Joined: 16 Jul 2003 Posts: 312 Location: Margretetorp
|
Posted: Fri Apr 24, 2009 2:21 pm Post subject: |
|
|
| mdeininger wrote: | | yeah that's pretty heavyweight alright :D. kind of reminds me of the arm cluster i'm occasionally emulating on my desktop; lucky i limit those to 32 megs per node :D. |
Just for fun, a bit of "top":
| Code: | top - 16:18:20 up 8 days, 2:45, 9 users, load average: 3.03, 3.03, 3.00
Tasks: 239 total, 4 running, 235 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.4%us, 0.0%sy, 0.0%ni, 87.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 132304508k total, 131717844k used, 586664k free, 340268k buffers
Swap: 7815580k total, 1151852k used, 6663728k free, 24784720k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12694 user1 18 -2 53.0g 52g 1844 R 100 41.9 1191:56 wopr
830 user1 18 -2 44.7g 43g 1808 R 99 34.7 3385:46 wopr
11538 user2 18 -2 3821m 3.7g 1764 R 99 2.9 2677:10 Timbl
|
It runs debian, btw. :)
-peter |
|
| Back to top |
|
 |
bunder Bodhisattva


Joined: 10 Apr 2004 Posts: 5213
|
Posted: Fri Apr 24, 2009 3:45 pm Post subject: |
|
|
| i92guboj wrote: | | bunder wrote: | | i've almost maxed out the swap on my laptop quite a few times editing images in gimp. it's a real pain too, because the PSD's are supposedly big (8mb is big?) |
I know nothing about the psd internal format. But I guess they use some kind of compression algorithm. When dealing with images you don't have to look at the size of the psd, but at the size of the bitmaps once they are uncompressed on your ram, which is how they are when you open the file. And that size will be width*height*bpp plus other info that the file might contain like alpha channels and such. So, an image of 1024x768x24 will always take 18MB, even if the jpg container only takes 35k on your disk.
So, if the psd file takes 8mb in your hd it's very likely that it can take 2, 3, 5, 20 or 200 times more space in your ram. It all depends on the contents of the bitmaps that the file holds inside. Try saving it as an uncompressed bmp (not rle) to get an idea of the real size of the contents (and even then it would be only an approximation because in psd you can have lots of layers, while in bmp you have only one bitmap). |
it's a combination of the both... the images are 2048x2048 with upwards of 10 layers (one of them wireframe, but normally hidden)... when i export to jpg they only come out to 200kb. not entirely small.  _________________ goodbye fgo. it was nice knowing you. |
|
| Back to top |
|
 |
durian Guru


Joined: 16 Jul 2003 Posts: 312 Location: Margretetorp
|
|
| Back to top |
|
 |
bunder Bodhisattva


Joined: 10 Apr 2004 Posts: 5213
|
|
| Back to top |
|
 |
atrus123 Guru


Joined: 06 Jul 2005 Posts: 339 Location: Annapolis, MD
|
Posted: Fri Apr 24, 2009 4:36 pm Post subject: |
|
|
| bunder wrote: | | i92guboj wrote: | | bunder wrote: | | i've almost maxed out the swap on my laptop quite a few times editing images in gimp. it's a real pain too, because the PSD's are supposedly big (8mb is big?) |
I know nothing about the psd internal format. But I guess they use some kind of compression algorithm. When dealing with images you don't have to look at the size of the psd, but at the size of the bitmaps once they are uncompressed on your ram, which is how they are when you open the file. And that size will be width*height*bpp plus other info that the file might contain like alpha channels and such. So, an image of 1024x768x24 will always take 18MB, even if the jpg container only takes 35k on your disk.
So, if the psd file takes 8mb in your hd it's very likely that it can take 2, 3, 5, 20 or 200 times more space in your ram. It all depends on the contents of the bitmaps that the file holds inside. Try saving it as an uncompressed bmp (not rle) to get an idea of the real size of the contents (and even then it would be only an approximation because in psd you can have lots of layers, while in bmp you have only one bitmap). |
it's a combination of the both... the images are 2048x2048 with upwards of 10 layers (one of them wireframe, but normally hidden)... when i export to jpg they only come out to 200kb. not entirely small.  |
That sounds about right for the jpg.
I bet if you were to max the jpeg quality and change your subsampling (found under Advanced Options of the save dialog) to 1x1,1x1,1x1, the file would be a hell of a lot larger. _________________ "I cannot support a movement that exploded spending and borrowing and blames its successor for the debt."
-Andrew Sullivan |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 30016 Location: 56N 3W
|
Posted: Fri Apr 24, 2009 6:17 pm Post subject: |
|
|
atrus123,
You can always make a swap file. Swap need not be a partition, its just faster that way as swapping does not involve the filesystem driver. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
TNorthover Guru


Joined: 25 Jan 2004 Posts: 434 Location: Edinburgh, UK
|
Posted: Fri Apr 24, 2009 6:23 pm Post subject: |
|
|
| NeddySeagoon wrote: | | You can always make a swap file. Swap need not be a partition, its just faster that way as swapping does not involve the filesystem driver. |
I believe it skips that during normal operation anyway. On initialisation it finds out which blocks it has and uses just uses those raw afterwards. |
|
| Back to top |
|
 |
energyman76b Advocate


Joined: 26 Mar 2003 Posts: 2022 Location: Germany
|
Posted: Fri Apr 24, 2009 6:42 pm Post subject: |
|
|
| NeddySeagoon wrote: | atrus123,
You can always make a swap file. Swap need not be a partition, its just faster that way as swapping does not involve the filesystem driver. |
that isn't true anymore (since 2.6 AFAIR). But it could still be faster - if the swapfile has holes... _________________
| AidanJT wrote: |
Libertardian denial of reality is wholly unimpressive and unconvincing, and simply serves to demonstrate what a bunch of delusional fools they all are.
|
Satan's got perfectly toned abs and rocks a c-cup. |
|
| Back to top |
|
 |
cokehabit Advocate

Joined: 23 Apr 2004 Posts: 3302
|
Posted: Fri Apr 24, 2009 7:02 pm Post subject: |
|
|
| Code: | leviathon ~ # free
total used free shared buffers cached
Mem: 2057568 1366068 691500 0 134516 735580
-/+ buffers/cache: 495972 1561596
Swap: 4000176 36352 3963824
| what a waste  |
|
| Back to top |
|
 |
eccerr0r Advocate

Joined: 01 Jul 2004 Posts: 3001 Location: USA
|
Posted: Fri Apr 24, 2009 7:55 pm Post subject: |
|
|
My (rough) rules for swap files/partitions:
Rule 1: If needed for swsusp, allocate enough for swsusp
Rule 2: If not using magnetic hard drives, swap = 0 and look for more RAM...
Rule 3: If system RAM is less than or equal to 256MB, set for 2x RAM size
Rule 4: All other cases: take single disk bandwidth and multiply by 15 seconds. Use that as a basis for swap size. If it exceeds 2X RAM, then cap at 2X RAM
Rule 5: If you have much more RAM than your apps really can use (don't count disk cache), then reduce swap partition size...
Recently I've been building/getting machines with more RAM than I really could use. Even at 1GB RAM, if I set things up properly and there are no leaks, I don't think I could use it all for apps (of course, cache will always be useful). Mostly I keep swap for some overflow protection as well as swapping out anything that won't be used for a while. Unused stuff in RAM that can't be freed (such as memory leaks) IS, however, wasted RAM. But you can swap out application memory leaks and go on, as if nothing ever happened...
Typically I cap out at 1GB swap or so, unless dealing with swsusp. A lot of machines I have 512MB mostly due to legacy calculations... _________________ Core-i7-2700K@4.1GHz/8GB RAM/180GB SSD/Intel HD3000 graphics
What the heck am I advocating? |
|
| Back to top |
|
 |
mdeininger Veteran


Joined: 15 Jun 2005 Posts: 1738 Location: University of Tuebingen, Germany
|
Posted: Tue Apr 28, 2009 5:25 pm Post subject: |
|
|
| durian wrote: | | mdeininger wrote: | yeah that's pretty heavyweight alright . kind of reminds me of the arm cluster i'm occasionally emulating on my desktop; lucky i limit those to 32 megs per node . |
Just for fun, a bit of "top":
| Code: | top - 16:18:20 up 8 days, 2:45, 9 users, load average: 3.03, 3.03, 3.00
Tasks: 239 total, 4 running, 235 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.4%us, 0.0%sy, 0.0%ni, 87.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 132304508k total, 131717844k used, 586664k free, 340268k buffers
Swap: 7815580k total, 1151852k used, 6663728k free, 24784720k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12694 user1 18 -2 53.0g 52g 1844 R 100 41.9 1191:56 wopr
830 user1 18 -2 44.7g 43g 1808 R 99 34.7 3385:46 wopr
11538 user2 18 -2 3821m 3.7g 1764 R 99 2.9 2677:10 Timbl
|
It runs debian, btw.
-peter | lol, funky, i don't think i've ever seen a 'g' used as a unit in top  _________________ "Confident, lazy, cocky, dead." -- Felix Jongleur, Otherland
( hot: jyujinX on Twitter | ef.gy ) |
|
| Back to top |
|
 |
cokehabit Advocate

Joined: 23 Apr 2004 Posts: 3302
|
Posted: Tue Apr 28, 2009 7:16 pm Post subject: |
|
|
| mdeininger wrote: | | durian wrote: | | mdeininger wrote: | yeah that's pretty heavyweight alright . kind of reminds me of the arm cluster i'm occasionally emulating on my desktop; lucky i limit those to 32 megs per node . |
Just for fun, a bit of "top":
| Code: | top - 16:18:20 up 8 days, 2:45, 9 users, load average: 3.03, 3.03, 3.00
Tasks: 239 total, 4 running, 235 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.4%us, 0.0%sy, 0.0%ni, 87.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 132304508k total, 131717844k used, 586664k free, 340268k buffers
Swap: 7815580k total, 1151852k used, 6663728k free, 24784720k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12694 user1 18 -2 53.0g 52g 1844 R 100 41.9 1191:56 wopr
830 user1 18 -2 44.7g 43g 1808 R 99 34.7 3385:46 wopr
11538 user2 18 -2 3821m 3.7g 1764 R 99 2.9 2677:10 Timbl
|
It runs debian, btw.
-peter | lol, funky, i don't think i've ever seen a 'g' used as a unit in top  | g is the best letter there is  |
|
| Back to top |
|
 |
poly_poly-man Advocate


Joined: 06 Dec 2006 Posts: 2477 Location: RIT, NY, US
|
Posted: Tue Apr 28, 2009 8:50 pm Post subject: |
|
|
gcc always gives me trouble on big emerges - I am constantly eating through swap. _________________ iVBORw0KGgoAAAANSUhEUgAAA
avatar: new version of logo - see topic 838248. Potentially still a WiP. |
|
| Back to top |
|
 |
cokehabit Advocate

Joined: 23 Apr 2004 Posts: 3302
|
Posted: Tue Apr 28, 2009 9:02 pm Post subject: |
|
|
| poly_poly-man wrote: | | gcc always gives me trouble on big emerges - I am constantly eating through swap. | Do you have strange CFLAGS or too high MAKEOPTS? |
|
| Back to top |
|
 |
mdeininger Veteran


Joined: 15 Jun 2005 Posts: 1738 Location: University of Tuebingen, Germany
|
Posted: Tue Apr 28, 2009 9:10 pm Post subject: |
|
|
| cokehabit wrote: | g is the best letter there is  | the letter to rule them all is, of course, the lambda! also kappa is pretty important in one of the contexts where lambda occurs . _________________ "Confident, lazy, cocky, dead." -- Felix Jongleur, Otherland
( hot: jyujinX on Twitter | ef.gy ) |
|
| Back to top |
|
 |
mdeininger Veteran


Joined: 15 Jun 2005 Posts: 1738 Location: University of Tuebingen, Germany
|
Posted: Tue Apr 28, 2009 9:11 pm Post subject: |
|
|
| poly_poly-man wrote: | | gcc always gives me trouble on big emerges - I am constantly eating through swap. | gcc or ld? ld is pretty evil on c++ linking. _________________ "Confident, lazy, cocky, dead." -- Felix Jongleur, Otherland
( hot: jyujinX on Twitter | ef.gy ) |
|
| Back to top |
|
 |
jdmulloy Tux's lil' helper


Joined: 24 Dec 2004 Posts: 139 Location: Massachusetts, USA
|
Posted: Tue Apr 28, 2009 9:12 pm Post subject: |
|
|
| cokehabit wrote: | | poly_poly-man wrote: | | gcc always gives me trouble on big emerges - I am constantly eating through swap. | Do you have strange CFLAGS or too high MAKEOPTS? |
Well of course you're going to hit swap on a machine that has 16MB of RAM.
 _________________ Joe Mulloy | http://twitter.com/jdmulloy | Ron Paul in 2012! | 5-1-07 | Unban Playfool | Fire your "Too big to fail" bank http://moveyourmoney.info |
|
| Back to top |
|
 |
eccerr0r Advocate

Joined: 01 Jul 2004 Posts: 3001 Location: USA
|
Posted: Tue Apr 28, 2009 9:12 pm Post subject: |
|
|
Compiling C++ programs tends to eat a lot of RAM.
I was trying to compile CenterICQ (CenterIM) on my DECstation 3100 (NetBSD). It has 24MB RAM at 16.6MHz, and compiling it would chew through all of swap (since it is a classic Un*x machine it has 48MB swap). Of course, it then ended up at the OOM killer.
Since I really didn't care what that machine was doing, I ended up letting it have 100MB more swap on another disk and let it go...
It took 3 days of nonstop swapping to finally complete building CenterICQ with just the ICQ personality enabled.
Then again it takes about 5 hours to compile a new NetBSD kernel. _________________ Core-i7-2700K@4.1GHz/8GB RAM/180GB SSD/Intel HD3000 graphics
What the heck am I advocating? |
|
| Back to top |
|
 |
cokehabit Advocate

Joined: 23 Apr 2004 Posts: 3302
|
Posted: Tue Apr 28, 2009 9:25 pm Post subject: |
|
|
| jdmulloy wrote: | | cokehabit wrote: | | poly_poly-man wrote: | | gcc always gives me trouble on big emerges - I am constantly eating through swap. | Do you have strange CFLAGS or too high MAKEOPTS? |
Well of course you're going to hit swap on a machine that has 16MB of RAM.
 | my watch has more ram than his computer... and it's analogue! |
|
| Back to top |
|
 |
poly_poly-man Advocate


Joined: 06 Dec 2006 Posts: 2477 Location: RIT, NY, US
|
Posted: Tue Apr 28, 2009 9:27 pm Post subject: |
|
|
might be ld - not sure - all I know is emerges take lots of ram.
I have 2gb ram, 512mb swap. _________________ iVBORw0KGgoAAAANSUhEUgAAA
avatar: new version of logo - see topic 838248. Potentially still a WiP. |
|
| Back to top |
|
 |
cokehabit Advocate

Joined: 23 Apr 2004 Posts: 3302
|
Posted: Tue Apr 28, 2009 9:27 pm Post subject: |
|
|
| eccerr0r wrote: | Compiling C++ programs tends to eat a lot of RAM.
I was trying to compile CenterICQ (CenterIM) on my DECstation 3100 (NetBSD). It has 24MB RAM at 16.6MHz, and compiling it would chew through all of swap (since it is a classic Un*x machine it has 48MB swap). Of course, it then ended up at the OOM killer.
Since I really didn't care what that machine was doing, I ended up letting it have 100MB more swap on another disk and let it go...
It took 3 days of nonstop swapping to finally complete building CenterICQ with just the ICQ personality enabled.
Then again it takes about 5 hours to compile a new NetBSD kernel. | you should do the pi test on it that is somewhere on a thread here |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|