This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Excessive memory usage by associative arrays


Sergey Klyaus <myautneko@gmail.com> writes:

> [...]
> - Each string is stored statically and MAP_STRING_LENGTH is 256 (i
> have 2 keys so its 256)
> - Plus statistics data gives us 1088 bytes per entry
> - SystemTap initializes map on per-cpu basis and do it with
> for_each_possible_cpu() (128 in my case)

Yes, unfortunately all those factors multiply.  You can control
MAXMAPENTRIES and MAXSTRINGLEN directly via -D options or other ways.
How many CPUs does your machine actually have?

See also
https://sourceware.org/systemtap/wiki/TipExhaustedResourceErrors 


> Of course, I may reduce MAXMAPENTRIES, but I think there is
> something wrong with such greedy allocation...

Its purpose is to ensure that no dynamic memory allocation occurs
during runtime, so is a safety measure.


> For the record, similiar DTrace script works perfectly (after I
> removed leak of records :) ).

Understood, though their situation is much simpler, and that toy
script can be made to work on stap in many ways.


- FChE


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