Closed Bug 841820 Opened 11 years ago Closed 11 years ago

Run the b2g identity frame with priority BACKGROUND_HOMESCREEN

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: justin.lebar+bug, Unassigned)

References

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

This is a hack I'm proposing to mitigate the worst consequences of bug 839500, since it doesn't look like we're going to get that bug fixed in time.

If we give the identity frame priority BACKGROUND_HOMESCREEN, it will be killed after all background processes (including the homescreen, because presumably the identity frame uses less memory than the homescreen).  But it will be killed before any foreground processes, thus allowing fg processes to make use of the memory used by the identity frame.

This still isn't ideal, because it means that the identity frame takes up 10mb that could be used by bg processes, and in my experience partners are very concerned about how much memory is available to bg processes.  But it would be a big improvement over the current state of affairs.

Note that even if apps may misbehave when the identity frame is killed, that's probably better than the alternative without this patch, where we'd kill the app itself.
Ben, can you point me to where we create this frame (in b2g)?

All we need to do is setAttribute('mozapptype', 'homescreen') and add a warning about this hack.
Oh, I found it.  I'll attach a patch in a moment.
Attachment #714491 - Flags: review?(jones.chris.g)
Attachment #714491 - Flags: review?(benadida)
Whiteboard: [MemShrink]
Comment on attachment 714491 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/8137

I don't understand, won't this still break identity when it's killed?  Can we just fix that bug?
Attachment #714491 - Flags: review?(jones.chris.g)
> I don't understand, won't this still break identity when it's killed?

Probably.  Again, the alternative is that we'd kill the fg app, which is probably worse?

> Can we just fix that bug?

I was not getting the impression that we'd be able to fix that bug in time for v1.0.1.
(In reply to Justin Lebar [:jlebar] from comment #5)
> > I don't understand, won't this still break identity when it's killed?
> 
> Probably.  Again, the alternative is that we'd kill the fg app, which is
> probably worse?
> 

The identify frame can certainly die while in the fg priority class as well.

> > Can we just fix that bug?
> 
> I was not getting the impression that we'd be able to fix that bug in time
> for v1.0.1.

Why not?  Sounds like we have a feature that can be relatively easily broken.

(That question isn't directed at you.)
> The identify frame can certainly die while in the fg priority class as well.

Yes, but as we've said, in the case when we're killing fg apps, that means that some fg app is using a lot of memory (since we've killed all non-fg apps by now).  And the fg app that's using a lot of memory is likely not the identity frame.  So therefore it's not likely that the identity frame will be killed.

The main exception would be the case when we're loading multiple browser tabs at once or something, since they're small.  But we're fixing that bug...
Why do we think the identity frame is going to use a small amount of memory?
(In reply to Chris Jones [:cjones] [:warhammer] from comment #8)
> Why do we think the identity frame is going to use a small amount of memory?

I think the line between "small" and "large" amount of memory is half of the memory available to apps (i.e, not counting memory used by the root process).  Because when we go to kill a fg process, assuming there are only two fg processes (which there should be), one must be using a "large" amount of memory, and we should kill that one.

I don't have great evidence that the identity process is not using 30+mb of memory, but I sure hope it isn't...
Comment on attachment 714491 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/8137

It sounds like Fabrice has an alternative (and better) plan here.
Attachment #714491 - Flags: review?(benadida)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: