console.memory?

1,878 views
Skip to first unread message

Mr.doob

unread,
Sep 20, 2010, 7:57:54 PM9/20/10
to Chromium-dev
Hello,

I've been trying to add a memory section to a performance monitor of
mine. For some reason "console.memory.usedJSHeapSize" and
"console.memory.totalJSHeapSize" return 0 all the time. In all OS.

Can that information be retrieved anymore? Maybe sits now somewhere
else?

Thanks!

Tony Gentilcore

unread,
Sep 20, 2010, 8:20:14 PM9/20/10
to ricardo...@gmail.com, Chromium-dev
You need to run with the command line switch --enable-memory-info and
in Chrome 6+, you'll find memory under window.webkitPerformance
instead of window.console.

> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
>    http://groups.google.com/a/chromium.org/group/chromium-dev
>

ricardo cabello

unread,
Sep 20, 2010, 11:01:52 PM9/20/10
to Tony Gentilcore, Chromium-dev
Thanks! Implemented.
http://github.com/mrdoob/stats.js

Is there any reason why --enable-memory-info is required?
Couldn't it be enabled by default?

Tony Gentilcore

unread,
Sep 20, 2010, 11:43:38 PM9/20/10
to ricardo cabello, Chromium-dev
On Mon, Sep 20, 2010 at 8:01 PM, ricardo cabello
<ricardo...@gmail.com> wrote:
> Thanks! Implemented.
> http://github.com/mrdoob/stats.js

Very cool demo!

>
> Is there any reason why --enable-memory-info is required?
> Couldn't it be enabled by default?

Some background here:
http://www.mail-archive.com/webki...@lists.webkit.org/msg11479.html

ricardo cabello

unread,
Sep 22, 2010, 12:20:27 PM9/22/10
to mnag...@chromium.org, Chromium-dev, to...@google.com
I've added the Safari instructions on the project page.
Thanks guys!


On 21 September 2010 08:56, Mikhail Naganov <mnag...@chromium.org> wrote:
> Hi Ricardo,
>
> This feature is hidden behind a flag mostly because of security
> considerations. As the memory reported is for the whole VM, another
> page (or iframe) even from other domain, can access these stats about
> your site, which is considered dangerous.
>
> BTW, memory info is implemented in WebKit, so it's possible to access
> memory stats in Safari, too. You need the latest WebKit version. To
> make stats available, open
> ~/Library/Preferences/com.apple.Safari.plist file for editing, and add
> & set enabled a boolean preference WebKitMemoryInfoEnabled (see
> attach).

Reply all
Reply to author
Forward
0 new messages