Closed Bug 813843 Opened 12 years ago Closed 11 years ago

Add a memory reporter for internal OpenGL data

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 893865

People

(Reporter: n.nethercote, Unassigned)

References

Details

(Whiteboard: [MemShrink:P2])

+++ This bug was initially created as a clone of Bug #813783 +++ The main B2G process and any content processes that use WebGL have 750 KiB worth of allocations through mozilla::gl::GLLibraryEGL::fCreateContext. It would be good to report this, though it won't be easy, as it will require wrapping malloc/free somehow. Bug 813783 comment 14 and 17 have a suggestion.
Summary: Do something about mozilla::gl::GLLibraryEGL::fCreateContext memory consumption → Add a memory reporter for the WebGL library on B2G
Whiteboard: [MemShrink] → [MemShrink:P2]
To be clear, there is no such thing as a 'WebGL library' (that would be libxul if anything) and bug 813783 was not specific to WebGL. The issue discussed there is that each OpenGL context we create uses 750k upon creation (probably more once we start using it) and it would be nice to be able to account for that memory usage in about:memory. I'd rename the bug accordingly but I'm not clear on another part: why "on B2G"? I think we should keep this a platform-agnostic "report internal OpenGL memory usage in about:memory" bug, unless you know a specific reason to make it B2G-specific?
It's more important on B2G because the main process always has WebGL stuff going on, which isn't true on desktop.
Summary: Add a memory reporter for the WebGL library on B2G → Add a memory reporter for internal OpenGL data
Does B2G still use WebGL right away upon boot? I thought that WebGL was only used in some Gaia applications like the Camera and Gallery. But granted, these applications will be frequently used, and anyway B2G does use OpenGL compositing at all time, like we do on Android, so this will always, unconditionally show up in about:memory, regardless of whether WebGL is used; and it is a specific concern on B2G as we aim for B2G to run on particularly low-spec devices.
So, anyway, the idea outlined in Bug 813783 comment 14 and 17 relies on --enable-replace-malloc and our ability to ship a replace-malloc library tracking the number of allocated bytes. So, - do you envision us shipping this by default in our official build? - or do you envision this being a non-default build option? - in that case are you OK with this waiting for bug 804303 to land and then just providing a standalone replace-malloc library, not even in mozilla-central --- or do you envision more integration into the tree?
I don't have clear ideas how this would work; I just filed it in case someone could see a way to do it. But a memory reporter that only works in special builds or special invocations of Firefox is of limited use.
Agreed; as discussed in bug 804303, it should be possible to enable replace-malloc by default, as it has negligible overhead. That's a conversation that one would have to have rather with glandium and, if it's going to be enabled only on B2G for now, with B2G people. CC'ing.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.