Opened 5 weeks ago

Closed 4 weeks ago

#1541 closed defect (fixed)

Memory is sometimes not released by free() in libc

Reported by: dmisev Owned by: dmisev
Priority: critical Milestone: 9.4
Component: rasserver Version: development
Keywords: Cc: pbaumann
Complexity: Medium

Description (last modified by dmisev)

It appears that in some cases memory is not really released and returned by free(). It's pretty complex and not very clear why. Especially with GB of allocated memory for tiles, this is a huge issue.

So far I've come across one solution of replacing the system malloc with tcmalloc or jemalloc; but this still doesn't seem to work in all cases, e.g. it works on Ubuntu 16.04, but not on Ubuntu 14.04.

Another solution I stumbled upon is to use malloc_trim() into trying to force release all free memory from the top of the heap. I've placed this in ObjectBroker::clearBroker() (called on transaction commit/abort), and this appears to work consistently.

Change History (2)

comment:1 Changed 5 weeks ago by dmisev

  • Description modified (diff)

comment:2 Changed 4 weeks ago by dmisev

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.