Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/console/procmem/analysis.py
blob: a468acd3bebc3a391b2b73b631d191f44de9923b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import proc, proc_smaps

class Analysis:
	
	pid = 0
	
	def __init__(self, pid):
		self.pid = pid
	
	def DirtyRSS(self):
		smaps =	proc_smaps.ProcSmaps(self.pid)
		dirty = []

		private = 0
		shared = 0
		
		for map in smaps.mappings:
			private += map.private_dirty
			shared  += map.shared_dirty

		dirty = {"private": int(private), "shared": int(shared)}

		return dirty
	
	def ApproxRealMemoryUsage(self):
		maps = proc_smaps.ProcMaps(self.pid)
		size = (maps.clean_size/1024)

		return size