Closed Bug 1027434 Opened 10 years ago Closed 10 years ago

Report non-main-thread stacks in SystemMemoryReporter

Categories

(Toolkit :: about:memory, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(2 files, 1 obsolete file)

This is described in bug 1024805 comment #0 but it should have its own bug: once we tag Nuwa thread stacks to prevent them from being merged with other virtual memory areas, we should be able to more or less safely count non-main-thread stacks as their own type of allocation.

Also, we have access to thread names (as set with any of: prctl(PR_SET_NAME), pthread_setname_np, PR_SetCurrentThreadName, NS_SetThreadName, NS_NewNamedThread), which could be useful, and most threads in Gecko seem to be more or less descriptively named.
Attached patch bug1027434-stack-tag-hg0.diff (obsolete) — Splinter Review
Trying: https://tbpl.mozilla.org/?tree=Try&rev=4b65dae61874 — not that we have any tests for this, I don't think, but I also tested manually, and I'll attach the report.
Attachment #8444900 - Flags: review?(n.nethercote)
Attached file memory-reports
Memory reports with attachment 8444900 [details] [diff] [review] applied.
Comment on attachment 8444900 [details] [diff] [review]
bug1027434-stack-tag-hg0.diff

Review of attachment 8444900 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/base/SystemMemoryReporter.cpp
@@ +323,5 @@
> +  // thread pool library (as in, e.g., "Binder_2" or "mozStorage #1").
> +  //
> +  // Note: if this is ever needed on kernels older than 2.6.33 (early 2010),
> +  // it will have to parse /proc/<pid>/status instead, because
> +  // /proc/<pid>/comm didn't exist before then.

It'd be nice if in the failure case it used "<unknown>" or something like that as the name, rather than the empty string. I don't mind if you do that in this function or in the caller.
Attachment #8444900 - Flags: review?(n.nethercote) → review+
Suggestion applied.  Still works.  Carrying over r+.
Attachment #8444900 - Attachment is obsolete: true
Attachment #8445358 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/1707f30aa4b9
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: