0

I have a core of process from a system that kills a process if it allocates memory above a configured limit. It seems the process crashed because memory is fragmented. To confirm I want to know largest available free block of memory. Is there a way I can find it from a core.

user469635
  • 59
  • 1
  • 1
  • 5

1 Answers1

1

Suppose you are using Linux glibc, gdb plugins such as libheap, gef, pwndbg provides functionalities of inspecting the free chunks.

Also if you can make the OOM re-happen, you can try some memory allocator that have the functionality to pretty print the malloc arena layout by itself before it crashes (including jemalloc, see Use Case: Basic Allocator Statistics)

Valgrind may help if memory leaks, but I am not sure it is useful for memory fragmentation.

Thiner
  • 345
  • 1
  • 9