b2g process kgsl memory usage increases during capturing images from camera

RESOLVED INVALID

Status

P1
blocker
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: tkundu, Assigned: gerard-majax)

Tracking

({memory-footprint, perf})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [caf priority: p1][systemsfe][MemShrink])

Attachments

(6 attachments)

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?

Updated

4 years ago
Whiteboard: [CR 705464] → [caf priority: p1][CR 705464]
(Assignee)

Comment 3

4 years ago
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)
(Assignee)

Comment 5

4 years ago
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)
(Assignee)

Comment 6

4 years ago
(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)
(Assignee)

Comment 7

4 years ago
Created attachment 8482216 [details]
Patch to make the test take 300 pics
(Assignee)

Comment 8

4 years ago
Created attachment 8482218 [details]
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.
(Assignee)

Comment 9

4 years ago
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 :(
(Assignee)

Updated

4 years ago
Depends on: 1060427
(Assignee)

Comment 10

4 years ago
Created attachment 8482262 [details]
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.
(Assignee)

Comment 11

4 years ago
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)

Updated

4 years ago
Assignee: nobody → lissyx+mozillians
Whiteboard: [caf priority: p1][CR 705464] → [caf priority: p1][CR 705464][systemsfe]
(Assignee)

Comment 12

4 years ago
Created attachment 8482689 [details]
kgsl_master_kk.png

KGSL usage when running current master on Flame KK.
(Assignee)

Comment 13

4 years ago
Created attachment 8482690 [details]
kgsl_b2g32_kk.png

KGSL usage when running current 2.0 on Flame KK.
(Assignee)

Comment 14

4 years ago
Created attachment 8482729 [details]
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.

Updated

4 years ago
Keywords: footprint, perf
Whiteboard: [caf priority: p1][CR 705464][systemsfe] → [caf priority: p1][CR 705464][systemsfe][MemShrink]

Updated

4 years ago
blocking-b2g: 2.0? → ---
Status: NEW → RESOLVED
Last Resolved: 4 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.