Closed Bug 1061082 Opened 10 years ago Closed 10 years ago

b2g process kgsl memory usage increases during capturing images from camera

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: tkundu, Assigned: gerard-majax)

References

Details

(Keywords: memory-footprint, perf, Whiteboard: [caf priority: p1][systemsfe][MemShrink])

Attachments

(6 files)

STR:

1) Capture 300 images from camera without closing camera app
2) Run |while true; do adb shell cat /sys/class/kgsl/kgsl/page_alloc ; sleep 1; done| to monitor kgsl memory usage during this test.

b2g process kgsl memory usage is increasing from 2.97MB to 7.684 MB .

Are we storing camera preview images in memory during capturing images ?
Flags: needinfo?(khuey)
[Blocking Requested - why for this release]:
blocking-b2g: --- → 2.0?
Whiteboard: [CR 705464] → [caf priority: p1][CR 705464]
This may be 2.0 specific. As far as I could check on my Flame running a JB base system and a master build a couple of days ago:
 - kgsl page_alloc is at 3.4MB after booting
 - sitting on homescreen/lockscreen makes it increased at 6.9MB
 - launching Camera, it increases at 7.5MB
 - taking 15 pictures, it oscillates between 7.61MB and 7.56MB
For STR in comment 0 : You can MODIFY [1] to capture pic WITHOUT closing camera app. 

[1] https://github.com/mozilla-b2g/gaia/blob/v2.0/tests/python/gaia-ui-tests/gaiatest/tests/endurance/test_endurance_camera_photo.py 

Please try on 2.0 only .
Flags: needinfo?(lissyx+mozillians)
Thanks. FTR for anyone willing to investigate:
 - setup the python virtualenv for running gaia ui tests as usual,
 - from within the virtualenv, please make sure you are in tests/python/gaia-ui-tests
 - make sure the device is root (adb root if needed)
 - forward marionnette port (adb forward tcp:3939 tcp:2828)
 - run the hacked test as suggested by:

> GAIATEST_SKIP_WARNING=1 gaiatest --type=b2g --device=94fdcea6 --address 127.0.0.1:3939 --restart --testvars=gaiatest/testvars.json --html-output=results.html gaiatest/tests/endurance/test_endurance_camera_photo.py

This should run restart b2g and run the Camera and take pics.
Flags: needinfo?(lissyx+mozillians)
(In reply to Tapas[:tkundu on #b2g/gaia/memshrink/gfx] (always NI me) from comment #0)
> STR:
> 
> 1) Capture 300 images from camera without closing camera app
> 2) Run |while true; do adb shell cat /sys/class/kgsl/kgsl/page_alloc ; sleep
> 1; done| to monitor kgsl memory usage during this test.
> 
> b2g process kgsl memory usage is increasing from 2.97MB to 7.684 MB .
> 
> Are we storing camera preview images in memory during capturing images ?

Can you provide plots of the measures you are doing? What problem exactly are we trying to expose and address:
 - a too high kgsl value
 - a leak of kgsl memory

?
Flags: needinfo?(tkundu)
Attached image kgsl_master.png
Plotting the kgsl page_alloc use over time when taking 300 pics. This is on a master build, Flame with JB basesystem. I'll try with 2.0 builds from pvtbuilds to see if I do reproduce or if it could be KK specific.
And for now I'm blocked on working on this for 2.0 builds since I cannot get any adb working with 2.0 from pvtbuilds :(
Depends on: 1060427
Attached image kgsl_b2g32.png
This is the plot after running the same test against a v2.0 eng build, not only it does not expose any leak, but I also don't reproduce the values exposed.

My basesystem being JB in both case, it could be related to KK only.
I could build and flash a working Flame with KK, using base image v166, so I'll be able to cross check whether I do reproduce it or not in the very same environment as yours.
Assignee: nobody → lissyx+mozillians
Whiteboard: [caf priority: p1][CR 705464] → [caf priority: p1][CR 705464][systemsfe]
Attached image kgsl_master_kk.png
KGSL usage when running current master on Flame KK.
Attached image kgsl_b2g32_kk.png
KGSL usage when running current 2.0 on Flame KK.
Attached image kgsl_b2g32_kk_2000.png
This is with a 2.0 build on KK Flame, but with 2000 pictures taken. I don't see anything that looks obviously bad.
I don't think this is a blocker at this point in the release.
Flags: needinfo?(khuey)
We are unable to reproduce this issue now . We are re-running stability test for camera. I will update here if we still need to do anything here.
Keywords: footprint, perf
Whiteboard: [caf priority: p1][CR 705464][systemsfe] → [caf priority: p1][CR 705464][systemsfe][MemShrink]
blocking-b2g: 2.0? → ---
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(tkundu)
Resolution: --- → INVALID
Whiteboard: [caf priority: p1][CR 705464][systemsfe][MemShrink] → [caf priority: p1][systemsfe][MemShrink]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: