Why am I seeing "tcmalloc: large alloc == X bytes == Y in ndsd.log?

  • 7012805
  • 08-Jul-2013
  • 18-Jul-2013

Environment

eDirectory 8.8.7



Situation

Seeing a lot of messages like the following in the ndsd.log

...
tcmalloc: large alloc 1717877376 bytes == 0x150f4000 @
...


Resolution

This message isn't really an error per se, it more just informational.

There is an environmental variable, TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD, which by default is set to 1073741824 bytes.  ~1GB
So if there is an allocation that is == or exceeds 1GB of memory, this message will be displayed in the ndsd.log. 

If there is a great deal of memory in the server, such as greater than 8G - 32GB and/or a fairly large eDirectory database you may see this message more readily.  You can just modify the threshold to be greater than the typical alloc that your seeing in the ndsd.log. 


Cause

Allocation of memory exceeds threshold defined in the TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD environment variable.

Additional Information

TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD default: 1073741824 Allocations larger than this value cause a stack trace to be dumped to stderr. The threshold for dumping stack traces is increased by a factor of 1.125 every time we print a message so that the threshold automatically goes up by a factor of ~1000 every 60 messages. This bounds the amount of extra logging generated by this flag. Default value of this flag is very large and therefore you should see no extra logging unless the flag is overridden.

More information related to this message can be found at
http://stackoverflow.com/questions/9077457/how-to-trace-tcmalloc-large-alloc