[lttng-dev] memory usage depending on number and size of subbuffers

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Apr 16 13:32:39 EDT 2014


----- Original Message -----

> From: "Sébastien Barthélémy" <barthelemy at crans.org>
> To: lttng-dev at lists.lttng.org
> Sent: Wednesday, April 16, 2014 12:22:42 PM
> Subject: [lttng-dev] memory usage depending on number and size of subbuffers

> Hi all,

> LTTng uses more memory than I expected. On the simple experiment below one
> can see that the "cached" memory increases by

> subbuf_size*num_cpu*(num_subbuf+1)

> That's not a big deal, but I did not expect the "+1".

> Does somebody know where it comes from?

It is the extra sub-buffer needed for reading a sub-buffer while the 
other sub-buffers are written into. It's needed for snapshotting 
data while tracing is active. 

Thanks, 

Mathieu 

> -- Regards, Sebastien

> 12M == 2M*2*(2+1)
> 24M == 4M*2*(2+1)
> 20M == 2M*2*(4+1)
> 40M == 4M*2*(4+1)

> # grep processor /proc/cpuinfo
> processor : 0
> processor : 1

> # lttng create
> Session auto-20140416-180246 created.
> Traces will be written in /root/lttng-traces/auto-20140416-180246

> # free -m
> total used free shared buffers cached
> Mem: 1002 670 332 0 22 250
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng enable-channel channel0 --num-subbuf 2 --subbuf-size 2M -u
> UST channel channel0 enabled for session auto-20140416-180246

> # free -m
> total used free shared buffers cached
> Mem: 1002 682 320 0 22 262
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng destroy
> Session auto-20140416-180246 destroyed

> # lttng create
> Session auto-20140416-180317 created.
> Traces will be written in /root/lttng-traces/auto-20140416-180317

> # free -m
> total used free shared buffers cached
> Mem: 1002 670 332 0 22 250
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng enable-channel channel0 --num-subbuf 2 --subbuf-size 4M -u
> UST channel channel0 enabled for session auto-20140416-180317

> # free -m
> total used free shared buffers cached
> Mem: 1002 694 307 0 22 274
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng destroy
> Session auto-20140416-180317 destroyed

> # lttng create
> Session auto-20140416-180339 created.
> Traces will be written in /root/lttng-traces/auto-20140416-180339

> # free -m
> total used free shared buffers cached
> Mem: 1002 670 332 0 22 250
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng enable-channel channel0 --num-subbuf 4 --subbuf-size 2M -u
> UST channel channel0 enabled for session auto-20140416-180339

> # free -m
> total used free shared buffers cached
> Mem: 1002 690 311 0 22 270
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng destroy
> Session auto-20140416-180339 destroyed

> # lttng create
> Session auto-20140416-180406 created.
> Traces will be written in /root/lttng-traces/auto-20140416-180406

> # free -m
> total used free shared buffers cached
> Mem: 1002 670 332 0 22 250
> -/+ buffers/cache: 397 605
> Swap: 0 0 0

> # lttng enable-channel channel0 --num-subbuf 4 --subbuf-size 4M -u
> UST channel channel0 enabled for session auto-20140416-180406

> # free -m
> total used free shared buffers cached
> Mem: 1002 710 292 0 22 290
> -/+ buffers/cache: 397 605

> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140416/ea4418b0/attachment-0001.html>


More information about the lttng-dev mailing list