Results 1 to 4 of 4
Hi everyone,
I am using a system with 512 MB RAM. Is it possible to give a size of 8 GB to swap memory? If not then is it possible ...
- 06-14-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 2
Is 8 GB swap memory possible?
Hi everyone,
I am using a system with 512 MB RAM. Is it possible to give a size of 8 GB to swap memory? If not then is it possible to do it with 1 GB or 2 GB RAM?
Basically I want to run some C program which require an additional 8 GB (2^28 integers). Is it possible to give swap memory a size of ~ 8 GB and use it to store these integers? If I assign integers in normal way in the C program then they will not automatically go to swap memory and as soon as sufficient integers will get occupied (during program running) to overflow RAM, running will be stopped saying that its out of memory (as I noticed).
If its possible to store 2^28 integers (continuous array) in swap memory, what can be the way of assigning and accessing them in the program?
Sincerely,
Pankaj
- 06-14-2010 #2
There was a 4GByte limit on swap once.
Afaik, this is solved. So you can have a bigger swap.
Sorry to say, but your plan sounds a bit off..
You do not want a system to go into swap.
It will slow down the machine to a crawl.
If you *really* need to have all your 8GB in ram, then upgrade your machine to at least 12Gbyte
Other than that, a sql database server comes to mind.You must always face the curtain with a bow.
- 06-14-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 2
I forgot to take a factor of 8.
Sorry, I forgot to take a factor of 8. There are 2^31 integers associated. Actually, I was working on the program few years ago, and now again I want to work on it.
Yes it seems that accessing an integer from swap memory is considerably slower than accessing it from RAM. But, if the calculations leading to that integer are much time taking then it may be of worth to access it from swap (after calculating once).
I am also interested to know some general answer.
Is it possible to give as much space as we want to swap memory? If its possible to store >= 2^31 integers (continuous array) in swap memory, what can be the way of assigning and accessing them in a C program?
Sincerely,
Pankaj.
- 06-14-2010 #4
I am not a developer, but a sysadmin.
But yes, it is possible to define swap space of (nearly) arbitrary size.
Even whole and multiple terrabyte harddiscs, if you wish to do so.
Also, the kernel provides virtual memory to each process.
You would need a 64bit CPU and 64bit operating system at least for your purpose.
Even then, some HW restrictions apply.
For example: an atom CPU is 64bit, but can still only address 4GB.
A modern 64bit Xeon can, afaik, address 64bit - 12 reserved bits = 52bits of linear memory.
If I am not mistaken, each process started "sees" 2^52bit of linear memory.
Which is then mapped to real RAM and/or swap by the kernel.
I still dont understand, why you would want to do that.
If a developer would approach me with that request or code to deploy, I would flat out reject it..
- somewhat unpredictive behaviour, as it is up to the kernel then and what it swaps
- machine will be sluggisch slow, swapping all the time
- probably even to the point, there it becomes unresponsive: your process is already in swap and active. That means that an idle process like the ssh daemon will be very likely swapped out
- swap is no way of storing data. It can be deleted while rebooting, for example.
- also: even if the data would be in swap after reboot: there is no way of accessing it again.
- If you have to access big data, use well established databases...Last edited by Irithori; 06-14-2010 at 03:49 PM.
You must always face the curtain with a bow.


Reply With Quote