All of lore.kernel.org
 help / color / mirror / Atom feed
* memory usage depending on number and size of subbuffers
@ 2014-04-16 16:22 Sébastien Barthélémy
  0 siblings, 0 replies; 4+ messages in thread
From: Sébastien Barthélémy @ 2014-04-16 16:22 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 3487 bytes --]

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?


-- 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

[-- Attachment #1.2: Type: text/html, Size: 4937 bytes --]

[-- Attachment #2: Type: text/plain, Size: 155 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: memory usage depending on number and size of subbuffers
       [not found] <48CF5AC71E61DB46B70D0F388054EFFD3599CCCD@VAL-E-01.valcartier.drdc-rddc.gc.ca>
@ 2014-04-16 19:17 ` Mathieu Desnoyers
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2014-04-16 19:17 UTC (permalink / raw)
  To: Daniel Thibault, David Goulet; +Cc: lttng-dev

----- Original Message -----
> From: "Daniel Thibault" <Daniel.Thibault@drdc-rddc.gc.ca>
> To: lttng-dev@lists.lttng.org
> Cc: "mathieu desnoyers (mathieu.desnoyers@efficios.com)" <mathieu.desnoyers@efficios.com>
> Sent: Wednesday, April 16, 2014 3:12:27 PM
> Subject: RE: [lttng-dev] memory usage depending on number and size of subbuffers
> 
> ----------------------------------------------------------------------
> >> Date: Wed, 16 Apr 2014 18:22:42 +0200
> >> From: S?bastien Barth?l?my <barthelemy@crans.org>
> >>
> >> 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?
> 
> > Date: Wed, 16 Apr 2014 17:32:39 +0000 (UTC)
> > From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> > 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.
> >
> > Mathieu
> 
>    If I'm not mistaken, the "passing sub-buffer" is used in overwrite mode
>    (as opposed to discard mode), not especially for snapshot mode.  It is in
>    fact possible to run in snapshot+discard mode, although that may not be
>    very useful in most use cases.  Can you confirm, Mathieu?

While theoretically possible, I'm not even sure if we allow it, because
it's pretty much useless. But I suspect one could indeed force a channel in
discard mode for a snapshot session. David, can you confirm ?

Thanks,

Mathieu


> 
> Daniel U. Thibault
> Protection des systèmes et contremesures (PSC) | Systems Protection &
> Countermeasures (SPC)
> Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber
> Security (MCCS)
> R & D pour la défense Canada - Valcartier (RDDC Valcartier) | Defence R&D
> Canada - Valcartier (DRDC Valcartier)
> 2459 route de la Bravoure
> Québec QC  G3J 1X5
> CANADA
> Vox : (418) 844-4000 x4245
> Fax : (418) 844-4538
> NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
> Gouvernement du Canada | Government of Canada
> <http://www.valcartier.drdc-rddc.gc.ca/>
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: memory usage depending on number and size of subbuffers
@ 2014-04-16 19:12 Thibault, Daniel
  0 siblings, 0 replies; 4+ messages in thread
From: Thibault, Daniel @ 2014-04-16 19:12 UTC (permalink / raw)
  To: lttng-dev

----------------------------------------------------------------------
>> Date: Wed, 16 Apr 2014 18:22:42 +0200
>> From: S?bastien Barth?l?my <barthelemy@crans.org>
>>
>> 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?

> Date: Wed, 16 Apr 2014 17:32:39 +0000 (UTC)
> From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> 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. 
>
> Mathieu 

   If I'm not mistaken, the "passing sub-buffer" is used in overwrite mode (as opposed to discard mode), not especially for snapshot mode.  It is in fact possible to run in snapshot+discard mode, although that may not be very useful in most use cases.  Can you confirm, Mathieu?

Daniel U. Thibault
Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la défense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Québec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: memory usage depending on number and size of subbuffers
       [not found] <CAPkDDd40zkVK46vZ-x6SaDvBLvwufN219T+9d36neg95F0WH-g@mail.gmail.com>
@ 2014-04-16 17:32 ` Mathieu Desnoyers
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2014-04-16 17:32 UTC (permalink / raw)
  To: Sébastien Barthélémy; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 3443 bytes --]

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

> From: "Sébastien Barthélémy" <barthelemy@crans.org>
> To: lttng-dev@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@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 

[-- Attachment #1.2: Type: text/html, Size: 10613 bytes --]

[-- Attachment #2: Type: text/plain, Size: 155 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-16 19:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 16:22 memory usage depending on number and size of subbuffers Sébastien Barthélémy
     [not found] <CAPkDDd40zkVK46vZ-x6SaDvBLvwufN219T+9d36neg95F0WH-g@mail.gmail.com>
2014-04-16 17:32 ` Mathieu Desnoyers
2014-04-16 19:12 Thibault, Daniel
     [not found] <48CF5AC71E61DB46B70D0F388054EFFD3599CCCD@VAL-E-01.valcartier.drdc-rddc.gc.ca>
2014-04-16 19:17 ` Mathieu Desnoyers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.