inevity / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[sunos] Configuring thread cache size per thread #527

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
My application is using following data structures:
A class Record which will store records from each file.
Each object of class Record contains a hash_map to store input fields for each 
record. There are around 150 fields per record and each field of say average 
length 20 bytes. The hash_map stores pointer to the field name and a string of 
the actual field value.

I have an input file of size 1 GB and unfortunately the memory used by my 
application after reading and storing all this data shoots upto 38G.
We are using TCmalloc library in the application.
We spawn 8 threads in our application, but only one thread at a time is reading 
the input file and storing the information in memory

My question:
Is it possible to configure the thread cache size of TC Malloc for only one 
thread.
I believe if this can be done, the application will not eat up so much space?

When the application requests for more memory, is more memory allocated for all 
the threads or only the thread calling new or malloc?

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
We are using g++ (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Solaris version: SunOS joey 5.10 Generic_147441-07 i86pc i386 i86pc Solaris
rel75d1@joey:[rel75d1]:/export/home/rel75d1
google-perftools-1.7

Please provide any additional information below.

Original issue reported on code.google.com by gsso...@gmail.com on 9 May 2013 at 5:30

GoogleCodeExporter commented 9 years ago
Such a massive difference should not be caused by thread cache.

Please consider diagnosing your memory usage first. I.e. via: 
MallocExtension::instance()->GetStats(buffer, buffer_length);

as described at: http://gperftools.googlecode.com/svn/trunk/doc/tcmalloc.html

Original comment by alkondratenko on 6 Jul 2013 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by alkondratenko on 14 Jul 2013 at 3:40