Fire Memory Hog

(Paul Stevenson) #1

Ran out of app memory… Fire (2151) was using 45Gb of memory!
(it has been running for several days)

(marc hoffman) #2

Oh, wow. that seems excessive. i have not noticed this myself, Fire should be pretty lean, normally. Do you have any more details? Did you just have one project open, or did you work with multiple projects over the course of the days? did you close/reopen projects frequently? (none of those should be an issue, of course). Do you see a noticeable increase tied to specific actions if you check memory load while using it (eg “even time i build, it goes up X MB” or the like)?


(Paul Stevenson) #3

Yeah I wish I could give you more info.
Typically we see Fire 2151 uses about 300Mb
I did notice that it had over 5,000 ports… also typically nowhere near that.
(checking now, I have had 2181 running for 24 hours. It has over 4,400 ports… of which the first few hundred are associated with files, but the rest, ~300…4400 have no association)

I was running 2151 with basically one project, constantly open, and just rebuilding every now and then. Maybe a few times a day.
(but we do use it to build in the background with Android Studio and gradle)…

I also had 2181 running on the same machine, not sure for how long. A couple of days probably. And it was behaving.
I’ll keep an eye on it, but using 2181 exclusively now (we were transitioning).
Will let you know if I see any kind of pattern or repeat.

(marc hoffman) #4

hmm. ports? can ytou check with lsof what those ports connect to?

(Paul Stevenson) #5

I did the activity monitor info on ports and they all connected to files from the project…

also… just got a " Too many open files in system" warning… and Fire had 5,000+ ports.
sorry, should have checked… but I was in the middle of something so I just closed it.
I will post the lsof next time.

(Paul Stevenson) #6

Ok… so had it running for an hour or so…
building directly in fire 2181 and also via gradle in android studio

lsof -c Fire…

PIPE 0x95b83ba136ea195 16384
PIPE 0x95b83ba136ea495 16384
PIPE 0x95b83ba136e8f95 16384
PIPE 0x95b83ba136e9055 16384
PIPE 0x95b83ba136e8e15 16384
PIPE 0x95b83ba136ea615 16384
PIPE 0x95b83ba136e8755 16384
PIPE 0x95b83ba136e8b15 16384
PIPE 0x95b83ba136e9895 16384
PIPE 0x95b83ba136ea855 16384
PIPE 0x95b83ba136e8995 65536
PIPE 0x95b83ba136e9955 16384
PIPE 0x95b83ba136e8bd5 65536
PIPE 0x95b83ba136eab55 16384
PIPE 0x95b83ba136e8815 16384
PIPE 0x95b83ba136e8d55 16384
PIPE 0x95b83ba136ea0d5 16384
PIPE 0x95b83ba136e94d5 16384
PIPE 0x95b83ba136e9715 16384
PIPE 0x95b83ba136e9355 65536
PIPE 0x95b83ba136e85d5 16384
PIPE 0x95b83ba136e9115 16384
PIPE 0x95b83ba136e9655 16384
PIPE 0x95b83ba136e9595 16384
PIPE 0x95b83ba136e8ed5 16384
PIPE 0x95b83ba136ea315 16384
PIPE 0x95b83ba136ea255 16384
PIPE 0x95b83ba136e97d5 16384
PIPE 0x95b83ba136e8c95 16384
PIPE 0x95b83ba136ea3d5 16384
PIPE 0x95b83ba136e8a55 16384
PIPE 0x95b83ba136e88d5 16384
PIPE 0x95b83ba136ea555 16384
PIPE 0x95b83ba136ea6d5 16384
PIPE 0x95b83ba136ea795 16384
PIPE 0x95b83ba136ea915 16384
PIPE 0x95b83ba136eaa95 16384
PIPE 0x95b83ba136e8455 16384
PIPE 0x95b83ba136eacd5 16384
PIPE 0x95b83ba136eb395 16384
PIPE 0x95b83ba136eb215 16384
PIPE 0x95b83ba082fe595 16384
PIPE 0x95b83ba082fead5 16384
PIPE 0x95b83ba082fe655 16384
PIPE 0x95b83ba082ff015 16384
PIPE 0x95b83ba082fea15 16384
PIPE 0x95b83ba082fe7d5 16384
PIPE 0x95b83ba082ffa95 16384
PIPE 0x95b83ba082fd5d5 16384
PIPE 0x95b83ba082ffc15 16384
PIPE 0x95b83ba082fe895 16384
PIPE 0x95b83ba082fe955 16384
PIPE 0x95b83ba082fff15 16384
PIPE 0x95b83ba082fdf95 16384
PIPE 0x95b83ba082fe055 16384
PIPE 0x95b83ba082fe295 16384
PIPE 0x95b83ba082ff195 16384
PIPE 0x95b83ba082ff855 16384
PIPE 0x95b83ba082fd755 16384
PIPE 0x95b83ba082ff3d5 16384
PIPE 0x95b83ba082fe1d5 16384
PIPE 0x95b83ba082fdbd5 16384
PIPE 0x95b83ba082fef55 16384
PIPE 0x95b83ba082fd995 16384
PIPE 0x95b83ba08300395 16384
PIPE 0x95b83ba082fe355 16384
PIPE 0x95b83ba082fd815 16384
PIPE 0x95b83ba082fe715 16384
PIPE 0x95b83ba082ffe55 16384
PIPE 0x95b83ba082ff9d5 16384
PIPE 0x95b83ba082ff795 16384
PIPE 0x95b83ba082ffcd5 16384
PIPE 0x95b83ba082fdd55 16384
PIPE 0x95b83ba082fd515 16384
PIPE 0x95b83ba082fedd5 16384
PIPE 0x95b83ba082ff255 16384
PIPE 0x95b83ba082ff315 16384
PIPE 0x95b83ba08300215 16384
PIPE 0x95b83ba082fe4d5 16384
PIPE 0x95b83ba08300095 16384
PIPE 0x95b83ba082fda55 16384
PIPE 0x95b83ba082ff6d5 16384
PIPE 0x95b83ba082fd8d5 16384
PIPE 0x95b83ba082fee95 16384
PIPE 0x95b83ba082fdc95 16384
PIPE 0x95b83ba082fffd5 16384
PIPE 0x95b83ba082ffd95 16384
PIPE 0x95b83ba082fe115 16384
PIPE 0x95b83ba082ff555 16384
PIPE 0x95b83ba082fded5 16384
PIPE 0x95b83ba082fed15 16384
PIPE 0x95b83ba082ff915 16384
PIPE 0x95b83ba082ff615 16384
PIPE 0x95b83ba08300155 16384
PIPE 0x95b83ba082fde15 16384
PIPE 0x95b83ba082fe415 16384
PIPE 0x95b83ba082fdb15 16384
PIPE 0x95b83ba082fd455 16384
PIPE 0x95b83ba082ff495 16384
PIPE 0x95b83ba082ffb55 16384
PIPE 0x95b83ba083002d5 16384
PIPE 0x95b83ba082fd695 16384
PIPE 0x95b83ba082ff0d5 16384
PIPE 0x95b83b9ffe29d15 16384
PIPE 0x95b83b9ffe29c55 16384
PIPE 0x95b83b9ffe29b95 16384
PIPE 0x95b83b9ffe29dd5 16384
PIPE 0x95b83b9ffe29ad5 16384
PIPE 0x95b83b9ffe29e95 16384
PIPE 0x95b83b9ffe29f55 16384
PIPE 0x95b83b9ffe2a015 16384
PIPE 0x95b83b9ffe29a15 16384
PIPE 0x95b83b9ffe29955 16384
PIPE 0x95b83b9ffe2a0d5 16384
PIPE 0x95b83b9ffe2a195 16384
PIPE 0x95b83b9ffe2a255 16384
PIPE 0x95b83b9ffe2a315 16384
PIPE 0x95b83b9ffe29895 16384
PIPE 0x95b83b9ffe2a3d5 16384
PIPE 0x95b83b9ffe297d5 16384
PIPE 0x95b83b9ffe2a495 16384
PIPE 0x95b83b9ffe2a555 16384
PIPE 0x95b83b9ffe29715 16384
PIPE 0x95b83b9ffe2a615 16384
PIPE 0x95b83b9ffe2a6d5 16384
PIPE 0x95b83b9ffe29655 16384
PIPE 0x95b83b9ffe2a795 16384
PIPE 0x95b83b9ffe2a855 16384
PIPE 0x95b83b9ffe29595 16384
PIPE 0x95b83b9ffe2a915 16384
PIPE 0x95b83b9ffe2a9d5 16384
PIPE 0x95b83b9ffe294d5 16384
PIPE 0x95b83b9ffe2aa95 16384
PIPE 0x95b83b9ffe29415 16384
PIPE 0x95b83b9ffe2ab55 16384
PIPE 0x95b83b9ffe29355 16384
PIPE 0x95b83b9ffe29295 16384
PIPE 0x95b83b9ffe291d5 16384
PIPE 0x95b83b9ffe29115 16384
PIPE 0x95b83b9ffe2ac15 16384
PIPE 0x95b83b9ffe29055 16384
PIPE 0x95b83b9ffe28f95 16384
PIPE 0x95b83b9ffe28ed5 16384
PIPE 0x95b83b9ffe28e15 16384
PIPE 0x95b83b9ffe28d55 16384
PIPE 0x95b83b9ffe2acd5 16384
PIPE 0x95b83b9ffe28c95 16384
PIPE 0x95b83b9ffe2ad95 16384
PIPE 0x95b83b9ffe2ae55 16384
PIPE 0x95b83b9ffe2af15 16384
PIPE 0x95b83b9ffe2afd5 16384
PIPE 0x95b83b9ffe28bd5 16384
PIPE 0x95b83b9ffe28b15 16384
PIPE 0x95b83b9ffe2b095 16384
PIPE 0x95b83b9ffe28a55 16384
PIPE 0x95b83b9ffe28995 16384
PIPE 0x95b83b9ffe288d5 16384
PIPE 0x95b83b9ffe28815 16384
PIPE 0x95b83b9ffe28755 16384
PIPE 0x95b83b9ffe2b155 16384
PIPE 0x95b83b9ffe2b215 16384
PIPE 0x95b83b9ffe28695 16384
PIPE 0x95b83b9ffe285d5 16384
PIPE 0x95b83b9ffe2b2d5 16384
PIPE 0x95b83b9ffe2b395 16384
PIPE 0x95b83ba00371b15 16384
PIPE 0x95b83b9ffe28455 16384
PIPE 0x95b83ba09682895 16384
PIPE 0x95b83ba09682955 16384
PIPE 0x95b83ba096827d5 16384

so everytime I build the number of these pipe ports increases.

currently 446 open files
275 seem to be actual files… after that is pipes.

hope that helps

(marc hoffman) #7

Curious. thanx for the details, i‘ll see what i can do with that. Does your memory footorint also increase with each build? if so, by what ballpark?

(Paul Stevenson) #8

it seems like it goes up around 100Mb temporarily and then cleans up.
I don’t remember if 2151 had a leak with that…
so now I’ve had Fire open for a few hours… and were at 1230 open files… and yeah, the last 1000 of those are the PIPE variety…

(marc hoffman) #9

Ok, reproduced and fixed the leaked pipes per build (for friday;s beta and the upcoming 9.3 release). It seems that this Apple docs page lies to us when it says “You don’t need to send closeFile to this object or explicitly release the object after you have finished using it.”, closeFile does in fact need to be called… :frowning:

while 100MB seems a lot (unless you have a huge long build that generates a massive build log and.or error messages), having memory go up is expected, as long as it goes down again, i’ll not worry about that one, for now.

I can also confirm one more leak, and that is that if you close a project, not all memory actually its freed (i’m investigating that one next). So of over the course of a few days you’d close and reopen (the same or different) projects a lot, memory use would go up. Workaround would be to just not do that (eg, close down Fire altogether once in a while if you switch back and forth between projects a lot, or just keep them open if you frequently switch between a handful of projects).

That said, i will of course put high priority on fixing this one, and also keep on the lookout for more issues.


(marc hoffman) #10

Also now fixed, i believe.

(Paul Stevenson) #11

yeah I seem to remember I looked at that in 2151 and it wasn’t going back down completely…
I wasn’t concerned at all about 100Mb up as you say, as long as it comes down again that’s all good.

glad you were able to fix them all.

(marc hoffman) #12

Looking forward to your feedback, once you had a chance to run the new build; these fixes should be in tomorrow’s beta.

(marc hoffman) #13

Oh, and thanx for bringing these to my attention / pushing me to finally look at these :wink: