gcore
attaches gdb
to a process, runs through most of the virtual memory areas of a process and dumps them to disk. Does this mean that every piece of anonymous virtual memory will need to be paged into memory within that process and thus increase its RSS, or is the memory paged into the gdb
process? I guess it will also page in any file-backed memory as well (although I guess that shouldn't increase RSS, although it might increase RAM use through file cache).
Example from a Kubernetes environment shows RSS jumps from 304368 to 17135624 (gcore
run from a worker node debug pod):
# ps auxwww | head -1
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
# ps auxwww | grep 3899524 | grep -v grep
1000650+ 3899524 0.2 0.9 17229416 304368 ? SLsl Jun13 54:01 /opt/java/openjdk/jre/bin/java [...]
# gcore 3899524
[...]
# ps auxwww | grep 3899524 | grep -v grep
1000650+ 3899524 0.2 53.3 17229416 17135624 ? SLsl Jun13 54:01 /opt/java/openjdk/jre/bin/java [...]
Could this be related specifically to containers/cgroups?