<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Sébastien Barthélémy" <barthelemy@crans.org><br><b>To: </b>lttng-dev@lists.lttng.org<br><b>Sent: </b>Wednesday, April 16, 2014 12:22:42 PM<br><b>Subject: </b>[lttng-dev] memory usage depending on number and size of subbuffers<br><div><br></div><div dir="ltr"><div><div>Hi all, <br><div><br></div></div>LTTng uses more memory than I expected. On the simple experiment below
one can see that the "cached" memory increases by<br><div><br></div>subbuf_size*num_cpu*(num_subbuf+1)<br><div><br></div></div><div>That's not a big deal, but I did not expect the "+1".<br><div><br></div>Does somebody know where it comes from?</div></div></blockquote><div><br></div><div>It is the extra sub-buffer needed for reading a sub-buffer while the<br></div><div>other sub-buffers are written into. It's needed for snapshotting<br></div><div>data while tracing is active.<br></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu<br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div><br><div><br></div></div><div>-- Regards, Sebastien<br><div><br></div><br></div><div>12M == 2M*2*(2+1)<br>24M == 4M*2*(2+1)<br>20M == 2M*2*(4+1)<br>40M == 4M*2*(4+1)<br></div><div><br># grep processor /proc/cpuinfo<br>processor : 0<br>processor : 1<br><br># lttng create<br>Session auto-20140416-180246 created.<br>Traces will be written in /root/lttng-traces/auto-20140416-180246<br><div><br></div># free -m<br> total used free shared buffers cached<br>
Mem: 1002 670 332 0 22 250<br>-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><div><br></div># lttng enable-channel channel0 --num-subbuf 2 --subbuf-size 2M -u<br>
UST channel channel0 enabled for session auto-20140416-180246<br><div><br></div># free -m<br> total used free shared buffers cached<br>Mem: 1002 682 320 0 22 262<br>
-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><div><br></div># lttng destroy<br>Session auto-20140416-180246 destroyed<br><div><br></div># lttng create<br>Session auto-20140416-180317 created.<br>Traces will be written in /root/lttng-traces/auto-20140416-180317<br><br># free -m<br> total used free shared buffers cached<br>Mem: 1002 670 332 0 22 250<br>-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><br># lttng enable-channel channel0 --num-subbuf 2 --subbuf-size 4M -u<br>UST channel channel0 enabled for session auto-20140416-180317<br><div><br></div># free -m<br> total used free shared buffers cached<br>
Mem: 1002 694 307 0 22 274<br>-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><div><br></div># lttng destroy<br>Session auto-20140416-180317 destroyed<br><br># lttng create<br>Session auto-20140416-180339 created.<br>Traces will be written in /root/lttng-traces/auto-20140416-180339<br><div><br></div># free -m<br> total used free shared buffers cached<br>
Mem: 1002 670 332 0 22 250<br>-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><div><br></div># lttng enable-channel channel0 --num-subbuf 4 --subbuf-size 2M -u<br>
UST channel channel0 enabled for session auto-20140416-180339<br><div><br></div># free -m<br> total used free shared buffers cached<br>Mem: 1002 690 311 0 22 270<br>
-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><div><br></div># lttng destroy<br>Session auto-20140416-180339 destroyed<br><div><br></div># lttng create<br>Session auto-20140416-180406 created.<br>Traces will be written in /root/lttng-traces/auto-20140416-180406<br><br># free -m<br> total used free shared buffers cached<br>Mem: 1002 670 332 0 22 250<br>-/+ buffers/cache: 397 605<br>Swap: 0 0 0<br><br># lttng enable-channel channel0 --num-subbuf 4 --subbuf-size 4M -u<br>UST channel channel0 enabled for session auto-20140416-180406<br><div><br></div># free -m<br> total used free shared buffers cached<br>
Mem: 1002 710 292 0 22 290<br>-/+ buffers/cache: 397 605<br><div><br></div></div></div><br>_______________________________________________<br>lttng-dev mailing list<br>lttng-dev@lists.lttng.org<br>http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev<br></blockquote><div><br><br></div><div><br></div><div>-- <br></div><div><span name="x"></span>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com<span name="x"></span><br></div></div></body></html>