OpenRoberta / openroberta-lab

The programming environment »Open Roberta Lab« by Fraunhofer IAIS enables children and adolescents to program robots. A variety of different programming blocks are provided to program motors and sensors of the robot. Open Roberta Lab uses an approach of graphical programming so that beginners can seamlessly start coding. As a cloud-based application, the platform can be used without prior installation of specific software but runs in any popular browser, independent of operating system and device.
Apache License 2.0
125 stars 121 forks source link

Memory leak on uploading (and zooming) background image with Firefox ESR 68.2.0 64 bit #288

Closed germanicianus closed 1 year ago

germanicianus commented 5 years ago

The first time I uploaded a simulation background image, it has been displayed, but was extremely zoomed in. Therefore I tried to zoom out with the mouse wheel (rolling it back). This lead to Firefox eating up all the RAM and thrashing the paging file. In the end even the mouse pointer was frozen and I had to hard reset the computer.

System: Windows 7 SP 1 on latest patch level Firefox ESR 68.2.0 64 bit

Steps to reproduce:

  1. Open https://lab.open-roberta.org/ and choose EV3.
  2. Click SIM (right side).
  3. Right click simulation background between back of the robot and black track, click "Save Image as..." and save it somewhere.
  4. Click background image upload button and select previously saved image.
  5. Image is displayed extremely large.
  6. Open task manager with Ctrl-Shift-Esc and see Firefox eating up RAM slowly.
  7. Try to zoom out with mouse wheel rolling it back one or two clicks (not to much).
  8. See Firefox eating up RAM faster.

Once I had Firefox displaying the just uploaded background just briefly (also extremely large) - see the screenshot at the end.

Workaround: After uploading the background image, reload the page, select EV3 again and cycle through the background. The just uploaded one is there and will be displayed correctly.

What I also miss is the documentation on which pixel size the image has to have for which virtual cm size. I found that out uploading an image and comparing the pixel size with the ultrasonic sensor reading - it's apparently pixel/3 = cm.

simulation_custom_background_uploaded_then_missing

boonto commented 4 years ago

I split off the zoom problem in #318. This should fix the issue of uncontrollably rising memory consumption.

Additionally, I compared memory consumption of Firefox and Chrome when uploading a background image. For Chrome the memory consumption remained similar after uploading multiple backgrounds. For Firefox uploading an image has a definitive impact on the memory consumption. By uploading multiple images in a row the memory cost of the Lab tab alone can eat up to 700 MB in my tests. After GC ticks in the consumption lowers again.

rishabhdeepsingh commented 4 years ago

This problem is on Chrome too and I am not even able to upload the image.

boonto commented 4 years ago

@rishabhdeepsingh the uploading should be fixed with #273. Do you get significantly higher memory consumption on Chrome? I didnt with Chrome & Chromium on Ubuntu 18.04.

rishabhdeepsingh commented 4 years ago

No, I am not getting any high memory consumption.

boonto commented 4 years ago

Okay, then #273 should be enough for Chrome :)