Operating System - Linux
1748129 Members
3495 Online
108758 Solutions
New Discussion юеВ

Re: Application / memory management

 
Andrew Beal
Frequent Advisor

Application / memory management

Hi,

I have memory to spare at the moment, and there are a few things i would like to experiment with, i.e application / memory management, just as windows XP loads MS Office programs / IE into memory before the program is executed, I would like to be able to load e.g mozilla, evolution etc... into memory so when I start the program it loads alot faster than it currently does...

Any help would be greatly appreciated.

Cheers

Cyber

7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: Application / memory management

Too much time on your hands.

Let the kernel setting manage memory. Set swap to a reasonable figure between 1.0 and 2.0 times memory and montiro performance.

Linux is a much more efficient OS than Microsoft anyway and usually requires less tuning.

Unless you start running database servers, you should have little need to play with the kernel. Linux tunes itself quite nicely.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrew Beal
Frequent Advisor

Re: Application / memory management

thanks for that,

There is no dispute that linux is much more efficient, but that doesnt stop my curiosity as to how I could go about doing this... I imagine it to be like some kind of job control, where you click on a shortcut and it does a #fg %1 type of thing (obviously that doesnt work) however, I am sure others could find a use for this type of trick also regardless if they are running a database server or not.

So if anyone has any idea on how you could go about doing this, or if they have done it, I would appreciate it.

Thanks in advance,

Andrew
Martin P.J. Zinser
Honored Contributor

Re: Application / memory management

Hello SEP,

there are other reasons to have "installed images" than poor resource management. VMS e.g implements this since a long time already and this is more an issue of security and access management then of saving on load time on image activation (although it does not hurt with stuff like Mozilla either ;-). There even have been at least loose discussion about implementing something similar in Linux, but I am not aware that it did actually happen.

As for the original question, if you have way too much memory, maybe you could create a RAM disk and move the images you want to accelerate on there. You still need to get them loaded, but the IOs will be much faster.

Greetings, Martin
Mark Grant
Honored Contributor

Re: Application / memory management

Konqueror on KDE has a "preload" option which will preload one or more instances of itself so that it can appear to start up instantly.

Other than that, you can try setting the "sticky" bit on application binaries (chmod +t). This keeps an applications' text segment in memory so it doesn't need to be loaded again a second time. Of course, this means it needs to be loaded the first time but I imagine you could do something in the start up scripts to start and stop things once the sticky bit is set.
Never preceed any demonstration with anything more predictive than "watch this"
Robert Binkhorst
Trusted Contributor

Re: Application / memory management

Hi,

If you have memory to spare, how about creating a virtual disk in memory (like memdisk did under dos)?

HTH

Robert
linux: the choice of a GNU generation
Andrew Beal
Frequent Advisor

Re: Application / memory management

thanks for your replies,

I guess a ramdisk would give the desired effect, but I would only want to use this whilst I am running a particular application. So I might tinker with the chmod +t option, and see what comes from that, OH and the preload option in KDE.
Would it be possible to create a startup script to create a ram disk, and mount / unmount the application at the beginning and end of a session? (i have never created a ramdisk before)
dirk dierickx
Honored Contributor

Re: Application / memory management

2 things are available to speed up loading of programs;

first there is 'prelink', but this only works for C++ programs, like Mozilla and OOo (to name 2 biggies).

the second i know of is 'readahaed', this is indeed a smart simple hack and abuses the fact that linux caches almost anything if you have enough memory. this is started up at boot time and simply reads all files in the directories listed in the config file. by reading all these files they will be in the kernel cache and when linux needs them for real it can just fetch them from memory instead of disk. (ofcourse if you don't have enough memory this cache is cleared and you get no benefit, but if you do have enough ram it is blazing fast.)

these two things are available in fedora and gentoo afaik.