LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-07-2003, 12:47 AM   #1
excel28
Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 72

Rep: Reputation: 15
Put applications into memory


Is there a way to put something into memory? For example, if I put Mozilla in memory and when I run mozilla, it will come up quickly. So when I exit and start mozilla again, it doesn't take a long time to load.
 
Old 07-07-2003, 12:50 AM   #2
SocialParasite
Member
 
Registered: Feb 2003
Distribution: Slackware 10
Posts: 38

Rep: Reputation: 15
Doesn't that happen as a general rule?
 
Old 07-07-2003, 12:54 AM   #3
excel28
Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 72

Original Poster
Rep: Reputation: 15
I don't think so. Cause I heard that with windows, the reason why IE comes up really fast is because when you start windows, it puts IE into memory before you get to your desktop.

So in linux, when I have mozilla up, I can open up a new window by CTRL-N and it will come up with a new window really fast. But the reason why it comes up really fast is because its already in memory. So, thats why I want to put it into memory, or any other program.
 
Old 07-07-2003, 12:55 AM   #4
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Rep: Reputation: 31
Re: Put applications into memory

Quote:
Originally posted by excel28
Is there a way to put something into memory?
Are you referring to a Ramdisk drive?
 
Old 07-07-2003, 01:08 AM   #5
SocialParasite
Member
 
Registered: Feb 2003
Distribution: Slackware 10
Posts: 38

Rep: Reputation: 15
No, he/she is referring to pre-loading an application into memory at boot time, I think.
 
Old 07-07-2003, 01:12 AM   #6
excel28
Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 72

Original Poster
Rep: Reputation: 15
I don't care if its at boot time or if I have to do a command one time, but I think it would better if it's not on boot time because it would be more manageable. for example bash$ put2Mem mozilla.
 
Old 07-07-2003, 01:27 AM   #7
SocialParasite
Member
 
Registered: Feb 2003
Distribution: Slackware 10
Posts: 38

Rep: Reputation: 15
I can't think of a way to do that. I know that sometimes when you load a program and then close it it doesn't always let go of all the memory it was allocated, and that causes it to load faster. Not what you're looking for, though.
 
Old 07-07-2003, 01:30 AM   #8
zmedico
Member
 
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707

Rep: Reputation: 30
This is all handled automatically by the kernel's virtual memory. You may be able to tweak it somehow if you look into the kernel documentation. You can keep mozilla running and minimized, and the system will just swap it out if necessary. I guess what you really want is a version of mozilla that runs as a service (simlar to ie). That's the effect you get when you keep it running and minimized. You can create a script to open html documents in a running instance of mozilla.

Here's my script, which is name /usr/local/bin/mozilla
Code:
#!/bin/bash

maybe_remote()
{
	line=blah
	count=0
	while [ -n "$line" ]
	do
		read line
		if [ -n "$line" ]
		then
			if [ "`echo ${line} | cut -f 1 -d ' '`" = "${EFFECTIVE_USER}" ]
			then
				if [ "`echo ${line} | cut -f 2 -d ' '`" = "mozilla-bin" ]
				then
					for i in "$@"
					do
						if [ "${i}" == "-remote" ]
						then
							echo false
							return 1;
						fi
					done

					$MOZILLA -raise -remote "openurl(${1},new-tab)" > /dev/null
					echo true
					return 0
				fi
			fi
		fi
	done
	echo false
}

# main program

MOZILLA_HOME=/usr/local/lib/mozilla
cd $MOZILLA_HOME
MOZILLA=$MOZILLA_HOME/mozilla

EFFECTIVE_USER=`id -nu`
ps_output=`ps --no-headers -eo "%U %c" | grep ${EFFECTIVE_USER} | grep mozilla-bin`
DID_REMOTE=

if [ -n "$ps_output" ]
then
	DID_REMOTE=`echo $ps_output | maybe_remote "$@"`
fi

if [ "$DID_REMOTE" != "true" ]
then
	$MOZILLA "$@"
fi

Last edited by zmedico; 01-06-2004 at 12:49 AM.
 
Old 07-07-2003, 01:55 AM   #9
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 46
Hi excel28,

Good question you have here. Well, let me attempt to try and explain some concepts to you.

No matter how hard MS denies it, IE is actually part of the Windows OS itself. In fact it's an integral part that can't be removed no matter what. The only reason IE starts up as quick as it does is that it is always running in the first place.

By the way, have you seen the size of IEXPLORE.EXE? It's a mere 89kb! Don't you think that this is quite strange?

So in a sense, IE wasn't preloaded... it's ALWAYS running, whether you're browsing the net or not.
 
Old 12-02-2003, 01:55 PM   #10
zmedico
Member
 
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707

Rep: Reputation: 30
"mozilla [url]" now works even while mozilla is already running

I noticed while running mozilla 1.5 that "mozilla [url]" now works even while mozilla is already running (before it would complain about the user's profile being in use already). That makes the annoying little script I posted above unnecessary.

BTW- It's possible to preload a program into the buffer cache like this.
Code:
for i in `find /usr/lib/mozilla-1.5 -type f`; do cat ${i} >  /dev/null; done
 
Old 12-02-2003, 02:17 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Yep, but depending on the size of your RAM
and the systems overall activity it might not stay
for too long ;)

I guess in Mozilla's special case it might make
sense to invoke an instance from ./xsession and
then use command-line parameters to create a
new view with the URL you want to open.


Cheers,
Tink



P.S.: In OO 1.0.3 the feature not to unload from
memory for such and such time worked just dandy,
I used to have it set to 8 hours, and all consecutive
starts of OO were rather quick).
In 1.1.0 it doesn't seem to work anymore (at least
not on my 2 machines) .... can someone confirm
this?
 
Old 12-03-2003, 11:26 AM   #12
zmedico
Member
 
Registered: Feb 2002
Location: Mission Viejo, California, USA
Distribution: Gentoo
Posts: 707

Rep: Reputation: 30
Quote:
in Mozilla's special case it might make
sense to invoke an instance from ./xsession and
then use command-line parameters to create a
new view with the URL you want to open.
Is it possible to keep mozilla running without a window? If so, how? It starts up quickly enough on my computer but I'm just curious.

Quote:
In OO 1.0.3 the feature not to unload from
memory for such and such time worked just dandy,
I used to have it set to 8 hours, and all consecutive
starts of OO were rather quick).
In 1.1.0 it doesn't seem to work anymore (at least
not on my 2 machines) .... can someone confirm
this?
I'm using the Fedora openoffice.org-1.1.0-6 package and the only memory settings I see are for undo, caching of graphics, and caching of inserted objects. I think I remember seeing what you're talking about in OO 1.0.3 but it seemed strange to me. The kernel's virtual memory system should be able to swap anything out of memory any time it needs/decides to, right? Is there some system call that increases the priority of keeping a process's pages in memory? Similar to scheduling priority, but actually a paging priority.

Googling for "paging priority" and linux I found "mlock - disable paging for some parts of memory". Maybe that's what we're looking for...

BTW, this discussion isn't really Slackware specific. Maybe the moderator can move it to LInux - General.

Last edited by zmedico; 12-03-2003 at 12:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reduce memory to install? Put back after? What? pvdl Linux - Hardware 5 10-15-2004 12:46 AM
Who is Knowing about daemon applications and how to develop these applications? ms_890 Linux - Software 0 04-14-2004 02:04 AM
Applications consume huge memory amount in kernel-2.6.4 l2g Red Hat 3 04-09-2004 09:49 AM
red hat 9 is a memory hog, can i put it on a diet? set235 Red Hat 14 10-17-2003 04:26 AM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration