All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn at suse.de>
To: powertop@lists.01.org
Subject: [Powertop] Too much memory consumption by powertop
Date: Tue, 28 Apr 2015 17:58:05 +0200	[thread overview]
Message-ID: <1765755.qjI46OxpdT@skinner> (raw)

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

As powertop list is for subscribers only, here Takashi's
findings concerning a big memory waste fowarded:

----------  Forwarded Message  ----------

Subject: Too much memory consumption by powertop
Date: Tuesday, April 28, 2015, 05:32:41 PM
From: Takashi Iwai <tiwai(a)suse.de>
To: powertop(a)lists.01.org
CC: trenn(a)suse.de

Hi,

I noticed that powertop consumes way too much memory than needed.  It
constantly takes over 170MB RES, sometimes over 200MB.

Then I looked at profile, and it showed that most of memory is
allocated for newpad_sp().  Indeed, the current code allocates a pad
of the fixed size of 1000x1000 (!) for each tab, and we have five
tabs, so five times of that.  No wonder that such a small neat CUI
program is so hungry.

For example, a hack like below already reduces the memory footprint
to around 20MB, 90% cut.  Not bad.

--- a/src/display.cpp
+++ b/src/display.cpp
@@ -48,7 +48,7 @@ void create_tab(const string &name, cons
        if (!w)
                w = new(class tab_window);
 
-       w->win = newpad(1000,1000);
+       w->win = newpad(80,160); // XXX FIXME XXX
        tab_names.push_back(name);
        tab_windows[name] = w;
        tab_translations[name] = translation;

Can anyone look into this and give a better / smarter solution?


thanks,

Takashi
-----------------------------------------

             reply	other threads:[~2015-04-28 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 15:58 Thomas Renninger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-04-28 17:14 [Powertop] Too much memory consumption by powertop Alexandra Yates
2015-04-28 21:29 Kok, Auke-jan H
2015-04-28 21:54 Arjan van de Ven
2015-04-29 17:39 Alexandra Yates
2015-04-29 21:14 Alexandra Yates

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1765755.qjI46OxpdT@skinner \
    --to=powertop@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.