Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-17-2005, 12:37 PM   #1
LQ Newbie
Registered: Nov 2005
Posts: 5

Rep: Reputation: 0
process memory

Can a process take up no memory?

How would you check top more frequently?
Old 11-17-2005, 02:17 PM   #2
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
a running process by virtue of the code used to "run" takes up memory
Old 11-17-2005, 02:23 PM   #3
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
Every process takes some memory, because they're created by the system fork function.

you can increase top refresh if you press 's' and type new refresh interval

Last edited by Vookimedlo; 11-17-2005 at 02:24 PM.
Old 11-18-2005, 02:45 AM   #4
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Originally posted by Vookimedlo
Every process takes some memory, because they're created by the system fork function.

yea used to be with fork, pages just get labled copy on write so untill its used no copy of parent memory table but now with fork this is used or something like it (introduced in 2.4)
so each process gets its own page table context to run in.
so even if the process does nothing (contains no code at all) while it exists to the extent exec() can run it the page table itself takes up space.

hope i got that right this stuff confuses me to no end

Last edited by foo_bar_foo; 11-18-2005 at 02:54 AM.
Old 11-18-2005, 10:50 AM   #5
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175Reputation: 3175
A process takes up virtual memory ... for that portion of its data-segment which it is actually using at this moment in time. The code that it is executing may be shared with other processes; certainly the common-libraries are.

The amount of physical memory used by a process is constantly changing. And remember, Linux is lazy. It will let things pile-up in memory in case someone might need to use them again, reclaiming memory for other uses only when an actual need to do so manifests itself. Near-100% utilization of physical memory is quite normal.

Depending on your version of Linux, threads may also show up in the ps process-listing. But several threads will execute in the same data-segment, occupying little-more actual resources than the tiny amount of memory needed to hold the process control block.

Last edited by sundialsvcs; 11-18-2005 at 10:52 AM.
Old 11-18-2005, 04:42 PM   #6
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
this is getting interesting
ELF32 is actually quite complex and some of this stuff is up to the compiler i think.
ELF file contains/or can contain many many sections defined by the compiler
some sections are flagged to remain in the processes memory image during execution.
does this only mean virtual memory ? i don't know. some data sections are flagged writable.
there is a hash table of the executable symbols most likely in various layers of tables of tables and junk and various string tables that hold the header information. There are in fact at least 24 different sections used to execute a program. There is certainly some data space that is initialized in physical memory that contains no file backed data and can't be only virtual. Also as pointed out above since the context is initially that of the shell and then copied one would also assume the shell contains data not on disk and therefore in physical memory. Some of this is then reinitialized as unitialized writable data space (to zero ) by the new process. There are also 2 sections of initialized data not backed by disk that also are in physical memory.
As far as text segment goes if read only loadable segments exist and are flagged SHF_ALLOC i believe they will be loaded into physical memory as well. This does not incluude the executable instructions themselves.
As far as shared symbols are concerned again there are many different types of symbols and i believe some symbols also have non disk backed data associated with them
and the process gets a freshly initialized actual memory copy in a writable segment.


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
How to list the process using most memory adoyee Linux - Newbie 3 09-06-2012 03:11 AM
Process memory limit Costea Linux - Security 9 09-24-2006 01:42 PM
process memory consumption ilnli Linux - General 4 09-08-2005 07:13 PM
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 03:32 PM
Which process is eating up my memory? Li-Wen Linux - General 7 05-12-2003 07:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 PM.

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