Hi all,
I did try to add a SWAP file and all of the suggestions helped. I still tried to compile my application and
it took all of the 1G and 256MB I had as storage so I am guessing that there is an issue with the compilation
environment I am using. I am using a custom gcc which probably doesn't play nice on Fedora.
Chris
Tom Mitchell wrote:
On Sat, 13 Dec 2003, Chris Sparks wrote:
Hi Gregory,
Since I originally started with 128 MB this makes sense why itThe "easy" thing to do in this case is abandon the miminal swap you have and just make another (larger) swap partition to be used instead. The size of a swap partition is a matter of debate, but generally it sould be equal to or no more than twice as large as your physical memory.
suggested 256 MB. I had to increase the memory to 384 MB
because of the boat load of seg faults I was getting.
If your disk is fully allocated you cannot increase your swap partition without risking damage to the existing file systems. (a backup and restore will be needed)
However most swap related seg faults are book keeping checks not active block transfers so swap to files is a good solution! Compare and contrast calloc() and malloc().
When adding swap files, you will want to add pri=0 to the fstab for your existing 'raw' swap partition.
Then add your swap file with a larger priority to the system and fstab.
If you already have a swap file in addition to a swap partition and are still running out of 'virtual' memory you have the option of rebuilding the swap file to be larger or simply adding a second swap file at a higher priority.
I happen to like having layers of swap and when things actively
swap to the high priority swap files I likely have an application
or mix of applications to get fixed. Adding a swap file is much
safer (IMO) than repartitioning a disk with data.
Do you have an old 2-4GB disk you can use for swap? If you can add a dedicated swap device you may want it to have the best priority if it is fast enough.
See also "ulimit", there are lots of 'student' programs that would allocate memory up to the imposed limits then work within those bounds imposed by the administrator. Since most students never had unlimited resources they never code for it. The reverse may be true, check also ulimits just in case it is not swap that is the limiting resource.
Recursion is cool but....
# bc
define f ( x ) {
if( x != 1) return( x * f(x-1) )
if(x == 1 ) return(1)
}
x = 15
f(x)
x = 200000
f(x)
etc...