Memory consumption of iconv

Oliver Becker der.ole.becker@gmail.com
Fri Mar 21 11:53:00 GMT 2014


Hi,
 
I am developing a server software which spawns up to thousands of client 
processes which use iconv_open (through Qt) to later transform strings between 
different encodings. This works like a charm of course but after a while I 
recognized that every process used about 1MB (non shared) memory for the iconv 
data.
This allone is not that much but If you multiply it by the number of child 
processes, I get a huge size of multiple GB. If you take into account that I 
use the same locales in every child process this is not easy to understand.
 
I searched through the iconv/gconv sources but didn't get any farther when 
coming to the point where external module functions get called which allocate 
the actual data.
 
So my question is: Do the gconv_* functions which load the actual "big" (some 
KB) amount of data for transforming use shared memory segments (like shmget) 
and my system just doesn't report it? Or can't they use them because of some 
reason?
 
My thought of using shared memory is to just decrease the overall memory 
footprint of my application from ~1-10GB to several MB.
 
Thanks in advance.
 
Greetings,
 
Oliver



More information about the Libc-help mailing list