ente-io / ente

Fully open source, End to End Encrypted alternative to Google Photos and Apple Photos
https://ente.io
GNU Affero General Public License v3.0
16k stars 823 forks source link

Can't run AppImage on Fedora - JavaScript heap out of memory #2500

Open fryorcraken opened 3 months ago

fryorcraken commented 3 months ago

Description

Downloads AppImage

▶ ./ente-1.7.2-x86_64.AppImage 

<--- Last few GCs --->

[39109:0x1c84000f8000]      570 ms: Mark-Compact (reduce) 5.6 (14.7) -> 5.2 (7.7) MB, pooled: 0 MB, 4.22 / 0.00 ms  (average mu = 0.872, current mu = 0.008) last resort; GC in old space requested
[39109:0x1c84000f8000]      576 ms: Mark-Compact (reduce) 5.2 (7.7) -> 5.2 (7.2) MB, pooled: 0 MB, 5.84 / 0.00 ms  (average mu = 0.742, current mu = 0.002) last resort; GC in old space requested

<--- JS stacktrace --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

[1]    39109 IOT instruction (core dumped)  ./ente-1.7.2-x86_64.AppImage
▶ uname -a
Linux gearo 6.9.9-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 11 19:29:01 UTC 2024 x86_64 GNU/Linux

Version

1.7.2

What product are you using?

Ente Photos

What platform are you using?

Desktop - Linux

fryorcraken commented 3 months ago

No issue when using the provided rpm package.

mnvr commented 3 months ago

No issue when using the provided rpm package.

Interesting.

One other person had reported a similar issue earlier. They were also on Fedora (Fedora 39 VM on Qubes OS). However, they said they also faced the issue with the rpm. It was happening when the app was trying to upload 4 x 700 MB videos in parallel.

I've summarized the gist, but here is the link to the full Discord thread - https://discord.com/channels/948937918347608085/1253299055472410645

I don't have a solution for now since we've been unable to reproduce this unfortunately, we've tried with parallel uploads of multi GB videos too. I don't see how a priori why large video uploads would be problematic - the app chunks the video uploads - but likely I'm not able to connect the dots yet.

mnvr commented 3 months ago

For reference, the V8 heap is limited to a maximum size of 4GB (https://www.electronjs.org/blog/v8-memory-cage). It should be fine with my current understanding because the app doesn't load the entire video in memory, if everything is working properly the entire read-from-disk + encryption + upload should be happening streaming.

fryorcraken commented 3 months ago

Please note that I am not uploading anything from my desktop instance. I have uploaded ~3.5GB of data from my android phone (including some videos). This was my first install on desktop to simply access the pictures.

mnvr commented 3 months ago

Thank you, that is good info. This clarifies that it is not the large file upload that is causing the Fedora OOMs, the issue is something else.