#55977 Threads mess up the statistics

Package:
gmemusage
Source:
gmemusage
Description:
Displays a graph detailing memory usage of each process
Submitter:
Francois Gouget
Date:
2005-07-18 03:54:31 UTC
Severity:
normal
#55977#5
Date:
2000-01-23 07:00:31 UTC
From:
To:
	Here is what I mean. I'm running squid on my machine. Squid is
starting 18 threads which are counted as as many processes by gmemusage
so that the reported memory used by squid is 179496KB.
	This is more physical memory than I have on my machine! Then of
course everything else appears to be using a small percentage of memory.

	If we could detect that two pids are in fact just two threads of
the same process we could avoid counting the memory they use twice. One
way to do this would be to compare '/proc/*/map'. Hopefully another
technique can be used. AFAIK the kernel has this information and uses it
to avoid having to change the virtual->physical mappings when doing a
context switch between two threads.

	This is a degenerated case of the more general misaccounting of
'shared memory' problem mentioned in the TODO file. But as 'shown' above
it can be solved independently of this more general problem.

#55977#10
Date:
2000-10-12 11:04:45 UTC
From:
To:
severity 55977 wishlist

thanks

unfortunately AFAICT there is no easy or fast way to fix this under linux ATM.

Adrian

Adrian Bridgett <bridgett@hursley.ibm.com>
Internal: 7-245528   External: 01962-815528
MQSeries Glue Team, DE2R05, Hursley Park, UK, SO21 2JN (Mailpoint 211)

#55977#15
Date:
2000-10-12 12:40:12 UTC
From:
To:
severity 55977 wishlist

thanks

unfortunately AFAICT there is no easy or fast way to fix this under linux ATM.

Adrian

Adrian Bridgett <bridgett@hursley.ibm.com>
Internal: 7-245528   External: 01962-815528
MQSeries Glue Team, DE2R05, Hursley Park, UK, SO21 2JN (Mailpoint 211)