Skip to main content
Version: 3.14.x.x LTS

MemoryLeakFilter

The MemoryLeakFilter can be helpful to detect leaks. Use it if you think that the memory usage grows continually. The MemoryLeakFilter logs an error if all allocated bytes during a request are not freed when the request returns to the frontend. There are some filters that keep data with a longer lifetime than requests, so that even if the message is logged, this has not to be a "real" leak. The MemoryLeakFilter only covers request based leaks. Leaks within objects with a longer lifetime than a request are not covered by this filter. All known filters, which allocate data with a longer lifetime than requests are not taken into account by the MemoryLeakFilter, but there may be some special configuration that could still cause a potential leak.

To use the MemoryLeakFilter,

  • Preload the library libNevisMemoryLeakLib.so via LD_PRELOAD. Just add the following line to your env.cfg (where <path_to_the_lib> is usually '/opt/nevisproxy/webapp/WEB-INF/lib'):

    LD_PRELOAD=<path_to_the_lib>/libNevisMemoryLeakLib.so
  • Restart nevisProxy afterwards.

    Once a potential leak occurs, the following entry is logged into the log file:

    2014 09 17 13:18:49.610 isi3web MemLeakFlt 14606.00583.390e-14109563294359187-148838d026a-00000000 3-ERROR : MemoryLeakMemWrapper_1_0::_cleanup: (MemoryLeakFilter) potentially leaked 24 bytes for request 'POST /servlet/connector/http/proxy1/request/'. (ALLOCATED 24 bytes at 0x3a7e380: : no callstack available (0))
tip

Use the MemoryLeakFilter only on a test environment, not in production, because there could be a minor performance impact.

The MemoryLeakFilter is supported only on Linux.

Classname
ch::nevis::nevisproxy::filter::debug::MemoryLeakFilter
Library
libNPDebugFilters.so.1

Configuration

DumpCallstackInLog

  • Type: boolean
  • Default: false
  • Description: Dump the callstack into the log-file. This may only work for Linux-platforms.