This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Memory allocators / STL


Thanks for your reply!

The issue of a testcase is a bit tricky since i can't release all the code and writing a testcase and a load generator that would produce it will most likely take more time than we have been "given" by our management to solve the bug...

It seems like we can actually only reproduce this bug in the production enviorment - none of the testcases before launch indicated a problem :(

I have a "guts feeling" that it has to do with memory management. As i said we can compile the server without __USE_MALLOC and get the performance that we are looking for with one thread, as soon as multiple threads go to work we get the response times that you would expect from an original XT machine or worse...

Except for the STL's allocation (which in the case of not specifying __USE_MALLOC should become pthread_alloc if i have understood things correctly) we internally use malloc() to create the chunks of memory used for sending/recieving data via sockets, and besides that the MySQL client is probably also doing some kind of allocation.

Except for memory allocated for communication (sockets and mysql) we keep a rather large hash_map that contains "prefab" resultsets - a cache to put it simply.

I am very thankful for all input on this, and if someone feels like this is their own backyard and does consulting - let me know!

Brgds

/Stefan

Benjamin Kosnik wrote:

> An additional question:
> Has anyone an idea of why the application seems to run ok (not for a longer period
> of time, but anyway) when compiling __USE_MALLOC? Does this flag alter anything of
> the exception code inside STL or is the problem to some degree related to the
> memory allocation routines...

This is probably a purely memory allocation issue.

Without some kind of example code publicly posted so that others can
try to reproduce your problem, we'll not be able to do anything except
offer suggestions. (Which, like __USE_MALLOC, you've already tried.)

I don't suppose you could provide a testcase that shows the problem, so
the rest of us could take a crack at it?

-benjamin

-- 
Military intelligence is a contradiction in terms.
 
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]