Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Issue 332010: Expose a method to access amount of memory used by the current process. (Closed)

Created:
11 years, 2 months ago by antonm
Modified:
9 years, 4 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Expose a method to access amount of memory used by the current process.

Patch Set 1 #

Total comments: 6

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2

Patch Set 5 : '' #

Total comments: 4

Patch Set 6 : '' #

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -1 line) Patch
M webkit/api/public/WebKitClient.h View 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M webkit/api/src/ChromiumBridge.cpp View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M webkit/glue/webkitclient_impl.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M webkit/glue/webkitclient_impl.cc View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
antonm
Darin, I suspect this CL requires something like http://codereview.chromium.org/334010/show submitted into WebCore fist, correct?
11 years, 2 months ago (2009-10-23 19:17:39 UTC) #1
darin (slow to review)
http://codereview.chromium.org/332010/diff/1/5 File webkit/glue/webkitclient_impl.cc (right): http://codereview.chromium.org/332010/diff/1/5#newcode426 Line 426: static base::ProcessMetrics* process_metrics = base::ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle()); please wrap this ...
11 years, 1 month ago (2009-10-27 16:04:08 UTC) #2
antonm
Darin, thanks a lot for comments. I am putting memoryUsageMB right after notifyJSOutOfMemory in the ...
11 years, 1 month ago (2009-10-27 18:23:20 UTC) #3
darin (slow to review)
Shouldn't there also be a change to WebKitClient? I feel that lumping memoryUsageMB with JS ...
11 years, 1 month ago (2009-10-27 19:27:42 UTC) #4
antonm
I see what you mean now, Darin---thanks a lot for clarifications. May you have another ...
11 years, 1 month ago (2009-10-27 20:06:23 UTC) #5
darin (slow to review)
Looks good, just one nit: http://codereview.chromium.org/332010/diff/9001/7003 File webkit/api/public/WebKitClient.h (right): http://codereview.chromium.org/332010/diff/9001/7003#newcode160 Line 160: // Memory -------------------------------------------------------------- ...
11 years, 1 month ago (2009-10-28 19:18:12 UTC) #6
antonm
http://codereview.chromium.org/332010/diff/9001/7003 File webkit/api/public/WebKitClient.h (right): http://codereview.chromium.org/332010/diff/9001/7003#newcode160 Line 160: // Memory -------------------------------------------------------------- On 2009/10/28 19:18:12, darin wrote: ...
11 years, 1 month ago (2009-10-28 19:23:09 UTC) #7
darin (slow to review)
LG, please just fix these nits before committing: http://codereview.chromium.org/332010/diff/10001/1003 File webkit/api/public/WebKitClient.h (right): http://codereview.chromium.org/332010/diff/10001/1003#newcode165 Line 165: ...
11 years, 1 month ago (2009-10-28 23:50:14 UTC) #8
antonm
11 years, 1 month ago (2009-10-30 14:20:18 UTC) #9
Darin, thanks a lot for another round.

I didn't respond instantly as I waited to prerequisite change to go into WebKit.

If you fine with this CL, could you land it for me?

http://codereview.chromium.org/332010/diff/10001/1003
File webkit/api/public/WebKitClient.h (right):

http://codereview.chromium.org/332010/diff/10001/1003#newcode165
Line 165: virtual int memoryUsageMB() = 0;
On 2009/10/28 23:50:14, darin wrote:
> nit: two new lines below here

Done.

> also, wouldn't it be better for memoryUsageMB to return size_t or at least
> unsigned?

Sorry, already submitted change to WebKit (but it could be easily changed).

Overall, I hope that int would be enough for memory in MBs for some time (I hope
Chrome would never eat that much memory :).  And picking between signed and
unsigned I find int usually easier to deal with.

But if you like to see something different here, I'd change.

http://codereview.chromium.org/332010/diff/10001/1006
File webkit/glue/webkitclient_impl.cc (right):

http://codereview.chromium.org/332010/diff/10001/1006#newcode348
Line 348: ProcessMetrics::CreateProcessMetrics(base::GetCurrentProcessHandle());
On 2009/10/28 23:50:14, darin wrote:
> nit: indent by 4 spaces when continuing a line

Done.

Powered by Google App Engine
This is Rietveld 408576698