Am Donnerstag, den 20.09.2012, 09:29 -0400 schrieb Benjamin Smedberg:
> On 9/20/2012 9:14 AM, Estanislao Gonzalez wrote:
> > Hi,
> >
> > This is probably nothing... but I was testing something else and I wondered 
> > why there are so many calls to getrlimit about the size of the stack...
> >
> > These are the "top 10" calls from one second dump of strace for the 
> > xulrunner process (first field is the count):
> >
> > $ (strace  -p 10762 2>&1 & sleep 1 && pkill strace) | awk '{a[$0]+=1} END 
> > {for (k in a) {print a[k],k}}' | sort -k 1 -rn | head
> >
> > 58498 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) 
> > = 0
> > 53 read(13, 0xb4d65058, 4096)              = -1 EAGAIN (Resource 
> > temporarily unavailable)
> > 26 poll([{fd=4, events=POLLIN}, {fd=13, events=POLLIN}, {fd=6, 
> > events=POLLIN}], 3, 0) = 0 (Timeout)
> > 16 poll([{fd=4, events=POLLIN}, {fd=13, events=POLLIN}], 2, 0) = 0 (Timeout)
> > 12 semop(131073, {{0, -1, SEM_UNDO}}, 1)   = 0
> > 12 semop(131073, {{0, 1, SEM_UNDO}}, 1)    = 0
> > 6 poll([{fd=4, events=POLLIN}, {fd=13, events=POLLIN}, {fd=6, 
> > events=POLLIN}], 3, 9) = 0 (Timeout)
> > 5 write(7, "!", 1)                        = 1
> > 5 read(6, "!", 1)                         = 1
> > 5 poll([{fd=4, events=POLLIN}, {fd=13, events=POLLIN}, {fd=6, 
> > events=POLLIN}], 3, 0) = 1 ([{fd=6, revents=POLLIN}])
> >
> > so there are almost 60.000 calls per second (min:53.000 max:64.000) to 
> > RLIMIT_STACK ...
> This is while running Firefox? Or some other XULRunner-based app?
> 
> The ps list below shows seems to indicate that you're seeing the 
> plugin-container process for Flash player. If this is correct, and 
> you're looking at a Flash-based video, it is *probably* the Flash player 
> code which is making these getrlimit calls.  It would be good to get 
> some basic stack traces from the calls to verify my hunch, of course. If 
> they walk directly into libflashplayer.so then this is something you 
> should report to Adobe.
> 
> Does anyone know how expensive getrlimit is?
> 
> --BDS
> 

I did asume this was caused by the flash player library (to some extent). It is 
while running iceweasel (firefox debian version).

And you were right:

#0  0xb65dbd7a in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0xb320659f in ?? () from /usr/lib/flashplayer-mozilla/libflashplayer.so
#2  0xb2dce2e5 in ?? () from /usr/lib/flashplayer-mozilla/libflashplayer.so
#3  0xb320685c in ?? () from /usr/lib/flashplayer-mozilla/libflashplayer.so
#4  0xb3206f06 in ?? () from /usr/lib/flashplayer-mozilla/libflashplayer.so
#5  0xb65d77b0 in start_thread () from /lib/libpthread.so.0
#6  0xb653b0be in clone () from /lib/libc.so.6

So, wrong list :-)

getrlimit is not expensive at all... but that doesn't mean you can call it 
60.000 per second without incurring in any penalty...

Thanks,
Estani



-- 
Estanislao Gonzalez
Institute of Meteorology
Freie Universität Berlin
Climate System Modeling Working Group
Carl-Heinrich-Becker Weg 6-10, Room 079 AB/1
D-12165 Berlin

Phone: +49 30 838-71116
Mail: estanislao.gonza...@met.fu-berlin.de

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to