Re: help with huge memory consumption??



Bin Chen <binary.chen@xxxxxxxxx> wrote in part:
It is caused by pthread_create, I wrote a simple program and notice
the output the same of you, I don't know whether is it a bug:

[EXTRACT] for (i = 0;i < 1024;i ++)
if (pthread_create(&my_thread, NULL, &thread_proc, NULL) != 0)

The VmData increasing very fast, after a while:
VmData: 123108 kB

Or 120 kB per thread. A little fat (4 kB is minimum AFAIK) but I don't
know how much printf() uses [stomps].

Measuring memory usage is tricky due to Copy-on-Write page sharing.
Simple memory tools neglect multiple mappings and overcount horribly.

-- Robert

.


Quantcast