WebPlatformForEmbedded / WPEWebKit

WPE WebKit port (downstream)
210 stars 135 forks source link

WPE 2.38: Out of memory error while streaming any content with WebInspector open #1335

Open janani-balasubramanian-infosys opened 1 month ago

janani-balasubramanian-infosys commented 1 month ago

In RPi, there is a significant increase in memory consumption of WPEThunder when Webinspector is started along with the streaming of any content. But no crash is seen because there is no limit set for WPEThunder and We were able to stream for more than 1.5 hours. But, the memory max usage rapidly increases. Below are the observations in RPi.

root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.limit_in_bytes 9223372036854771712

root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 531464192 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 544538624 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 550207488 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 561790976 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 584716288 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 620036096 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 635936768 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 646520832 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 655519744 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 695853056 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 702447616 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 711151616 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 721469440 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 737206272 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 835309568 root@raspberrypi4-64-rdk-android-mc:/sys/fs/cgroup/memory# cat memory.max_usage_in_bytes 838696960

Every memory usage values are noted within 1-2 mins.

Scenario to reproduce

  1. Start any video streaming app
  2. Open WebInspector
  3. Play any VOD
  4. Notice the memory consumption
janani-balasubramanian-infosys commented 1 month ago

Below is an additional observation made by making the _JSCcriticalGCMemoryThreshold=0.10 .

With this change, the playback was running for almost 45 mins. In this, for the first 30 mins the memory increase was stable. But after 30 mins, the memory increase is very fast.

Image tested:

root@raspberrypi4-64-rdk-android-mc:~# cat /version.txt  imagename:rdk-generic-mediaclient-wpe-image_FBT_TDK_nightly-20240503-dunfell_20240503043146 BRANCH=nightly-20240503-dunfell YOCTO_VERSION=dunfell VERSION=nightly-20240503-dunfell.05.03.24 SPIN=0 BUILD_TIME="2024-05-03 04:31:46" WPE_WEBKIT_VERSION=2.38.4+gitAUTOINC+fc1703ed69-r4 WPEFRAMEWORK-VERSION=R4.2 Generated on Fri May 03  04:31:46 UTC 2024 JENKINS_JOB=0 JENKINS_BUILD_NUMBER=0