It appears that there is a bit of a memory leak on my HTTPS web server and HTTPS client. The common link is TLS.
After repeated serving of web pages to a given client (via the web server) or periodically connecting to an external server (via the client), printing malloc_info shows the arena/uordblks/keepcost counting in one direction (and that direction is "up").
I see various threads on TLS memory leaks on this forum, but none that are recent, helpful or conclusive.
I was wondering if anyone has observed this recently, and if so, were there any debugging techniques that were hepful? Digging into the underbelly of TLS doesn't sound like a fun project...
Going back to basics: I created a new Eclipse workspace with the default SDK. I built snip.https_server right from the SDK but added a while loop that periodically prints the heap stats (see attachment).
The default https_server exhibits the same heap expansion. (The test scenario is an HTTPS client written in Java which fetches the home page ever few seconds.) Every so often (few minutes, typically), the heap grows by 4kB. After running for an hour, or so, I can see the memory being slowly consumed:
-------------------SYS DBG MEM HEAP DIAGNOSTIC-----------------------
arena: 163736; /* total space allocated from system */
ordblks: 430; /* number of non-inuse chunks */
smblks: 0; /* unused -- always zero */
hblks: 0; /* number of mmapped regions */
hblkhd: 0; /* total space in mmapped regions */
usmblks: 0; /* unused -- always zero */
fsmblks: 0; /* unused -- always zero */
uordblks: 125816; /* total allocated space */
fordblks: 37920; /* total non-inuse space */
keepcost: 8232; /* top-most, releasable (via malloc_trim) space */