The drop_cache trick will not free memory, it will reset the cache.
Uses ps command if you want to identify which processes uses the more memory.
For instance to monitor the list of the top 15 of resident memory users.
$ watch "ps --sort -rss -eo pid,pmem,rss,vsz,comm | head -16"
PID %MEM RSS VSZ COMMAND
2590 13.4 136892 825000 firefox
1743 10.7 109020 300780 Xorg
2067 8.5 86764 1118140 unity-2d-shell
3307 4.1 42560 627780 unity-2d-spread
2068 2.9 29904 617644 unity-2d-panel
2092 2.5 25524 1291204 nautilus
2457 1.9 20292 530276 gnome-terminal
2351 1.9 20016 821488 unity-scope-vid
2161 1.9 19476 531968 unity-panel-ser
2034 1.7 18256 759716 gnome-settings-
2074 1.5 16176 518016 nm-applet
2273 1.5 15452 580416 unity-lens-vide
2051 1.4 15112 524260 metacity
2395 1.2 12836 407336 update-notifi
You could check also the shared memory reservation but you will only know who is the owner of the segments.
Pmap allocation:
$ ls -l /run/shm
total 272
-r-------- 1 ed ed 67108904 Nov 29 18:17 pulse-shm-1884617860
-r-------- 1 lightdm lightdm 67108904 Nov 29 18:11 pulse-shm-2352897759
-r-------- 1 ed ed 67108904 Nov 29 18:12 pulse-shm-3444873503
-r-------- 1 ed ed 67108904 Nov 29 18:12 pulse-shm-3485341848
-r-------- 1 lightdm lightdm 67108904 Nov 29 18:11 pulse-shm-535843976
-r-------- 1 ed ed 67108904 Nov 29 19:12 pulse-shm-789046959
-r-------- 1 ed ed 67108904 Nov 29 18:38 pulse-shm-863909656
$ df /run/shm
Filesystem 1K-blocks Used Available Use% Mounted on
none 509332 272 509060 1% /run/shm
note that reserved allocations are much higher than real the allocated pages (df 'used')
System V allocations :
$ ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 294912 ed 700 122880 2 dest
0x00000000 327681 ed 700 4823040 2 dest
0x00000000 491522 ed 600 393216 2 dest
0x00000000 589827 ed 700 4578120 2 dest
0x00000000 425988 ed 700 27852 2 dest
0x00000000 458757 ed 600 393216 2 dest
Edit: Need to pass --sort -rss
to ps
to get the processes with the most memory usage, otherwise the process list is sorted increasing numerical and gives the processes with least memory usage.