Process takes a long time to terminate, stuck in a stream of munmap

577 Views Asked by At

I have a Python 2.7 process (started by cron) on a Linux box that takes a very long time (10s of minutes) to terminate. While it is running, it uses a lot of memory (25GB) and it appears to take a lot of time releasing it.

strace reports an endless stream of

munmap(0x7fd5cd411000, 262144)          = 0
munmap(0x7fd5cb5d1000, 262144)          = 0
munmap(0x7fd5cb591000, 262144)          = 0
munmap(0x7fd5cb611000, 262144)          = 0
munmap(0x7fd5cb551000, 262144)          = 0
munmap(0x7fd5ccb11000, 262144)          = 0
munmap(0x7fd5cc991000, 262144)          = 0
munmap(0x7fd5cc951000, 262144)          = 0
munmap(0x7fd5cc591000, 262144)          = 0
munmap(0x7fd5ccb91000, 262144)          = 0
munmap(0x7fd5ccb51000, 262144)          = 0
munmap(0x7fd5cc291000, 262144)          = 0
munmap(0x7fd5cc251000, 262144)          = 0
munmap(0x7fd5cc211000, 262144)          = 0
munmap(0x7fd5cc1d1000, 262144)          = 0
munmap(0x7fd5cda11000, 262144)          = 0
munmap(0x7fd5cd111000, 262144)          = 0
munmap(0x7fd5cd0d1000, 262144)          = 0
munmap(0x7fd5cc4d1000, 262144)          = 0
munmap(0x7fd5cc411000, 262144)          = 0
munmap(0x7fd5cc151000, 262144)          = 0
munmap(0x7fd5cc091000, 262144)          = 0
munmap(0x7fd5cb911000, 262144)          = 0
munmap(0x7fd5cb8d1000, 262144)          = 0
munmap(0x7fd5cb891000, 262144)          = 0
munmap(0x7fd5cb451000, 262144)          = 0
munmap(0x7fd5cb391000, 262144)          = 0
munmap(0x7fd5cb3d1000, 262144)          = 0
munmap(0x7fd5cb351000, 262144)          = 0
munmap(0x7fd5cd5d1000, 262144)          = 0

ltrace reports nothing.

While it was alive, it used a GDBM database, but have been closed long ago. The open file descriptors are:

0 lr-x------ 1 sds sds 64 May 24 20:05 0 -> pipe:[36989242]
0 l-wx------ 1 sds sds 64 May 24 20:05 1 -> pipe:[36989243]
0 l-wx------ 1 sds sds 64 May 24 20:05 2 -> pipe:[36989243]
0 l-wx------ 1 sds sds 64 May 24 20:05 3 -> /home/sds/my/path/file.log
0 lr-x------ 1 sds sds 64 May 24 20:05 9 -> /dev/urandom

It will not write anything to the log file.

What is going on here? Is that an artifact of Python GC? GDBM?

Is there anything I can do (besides kill)?

0

There are 0 best solutions below