Closed mlcampbe closed 5 years ago
This probably is the same issue as #3, the earthporn images are huge and take up a lot of memory. reddit's api does return alternate sizes for image posts, if I find the time, I'll look into adding support for them and loading the smallest size that's still at least as large as the screen in each dimension. Or you could open a PR for it.
Does this only affect the earthporn reddit? I suspect not but I have changed my source to /r/LandscapePhotography+NaturePics+ITookAPicture+CampingandHiking and will see what happens.
No, it's just that the earthporn subreddit is more likely to have very large images. /r/LandscapePhotography sounds like another one that's going to have big images, so I would expect to see the issue there too.
I just pushed a change that may help, can you try it and report back?
Sure will do but note it may be a day or 2 before I can say one way or another. I will reset my source to use only earthporn and let it run. I will report back once I have more info.
So far so good but it is way too early to tell. However, I was reviewing the source and while I am no means a javascript programmer I wanted to ask about a potential problem I see. In MMM-Wallpaper.js in the getDom() function you create a wrapper div element and then use appendChild to add 2 images and a title. Is there any possibility that you are not clearing out the old elements on each call to getDom() (and garbage collection is not occurring) and thus over time the div just has a lot of entries appended to it thus filling memory?
That would not explain why the problem only occurs with the reddit source unless the other sources just use way smaller images and it would take a much longer time to use up the memory. Just a thought.
MagicMirror's core handles replacing the old div with the new one generated by getDom(), so that's not going to be the issue.
Like I said I'm not a programmer but thought it was worth a shot.
Nope, still crashed on Friday afternoon. I took a look at your changes and they are focused on the variants in the reddit json output. However, very if any of the reddit entries even have a variant defined at all.
Actually, try disabling crossfade in your config, I remember adding that to help with some crashes on my pi zero
No still crashing even with the new changes and crossfade=false. For now I am going to remove earthporn from the source and go with some other subreddits and see if they fail or not.
I've been using the module without the EarthPorn pictures for 10+ days and still no crash since then.
Do you think that this might have to do with the setting for maximumEntries? I see you build a list of maximum entries but are you downloading all of them at one time? If so do you think that using a smaller value for maximumEntries would help?
No, the most that would ever be loaded at once is two, during the crossfade time if crossfade is set to true. With that set to false, only one image should ever be loaded at a time. I really think it just comes down to the earthporn images being huge. The only other thing I can think of is to tweak the logic around choosing an alternate size, and just have a maximum size allowed instead of choosing the smallest size that still covers the whole screen. If I get some time, I'll try to put something on a branch for you to try
On Fri, May 10, 2019 at 11:33 AM Mike Campbell notifications@github.com wrote:
Do you think that this might have to do with the setting for maximumEntries? I see you build a list of maximum entries but are you downloading all of them at one time? If so do you think that using a smaller value for maximumEntries would help?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kolbyjack/MMM-Wallpaper/issues/5#issuecomment-491331417, or mute the thread https://github.com/notifications/unsubscribe-auth/AACCGR6GCVUTEZCIVYFR4SDPUWIS3ANCNFSM4HGUW6PA .
I've added maxWidth/maxHeight config settings, try updating and setting maxWidth: 1920 in your config, that should prevent the huge images from loading. Unfortunately, that will mean that anything larger than 1920 width will only load at a width of 1080, as that's the largest non-native variant reddit provides
Ok I've updated and added the maxWidth setting. I presume I don't need to add maxHeight at all if I have the max width defined. I'll see what happens and let you know.
so far so good and no crashes
I'm going to go ahead and close this issue, then, go ahead and reopen it if it starts happening again, I guess
Jon,
I’d have to say the problem is fixed. I’ve been running with EarthPorn as the only source for almost 10 days now and no crashes at all. Thanks for the hard work!
Mike Campbell mlcampbell@gmail.com
On May 15, 2019, at 7:09 PM, Jon Kolb notifications@github.com wrote:
Closed #5 https://github.com/kolbyjack/MMM-Wallpaper/issues/5.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kolbyjack/MMM-Wallpaper/issues/5?email_source=notifications&email_token=ADINDLK57LESM4TVTGY5CN3PVSQ3NA5CNFSM4HGUW6PKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGORPCJOVA#event-2344916820, or mute the thread https://github.com/notifications/unsubscribe-auth/ADINDLJRMKUWN4IIKKCD4EDPVSQ3NANCNFSM4HGUW6PA.
I have a suspicion that I am seeing the same problem as reported in issue #3. I have MMM-Wallpaper installed and on occasion I am seeing that the screen goes black and I have a core dump generated. I am seeing out of memory issues on at various times.
I'm not concerned about the force_s3tc_enable messages but the out of memory errors are crashing my MM and causing the black screen.
I have not 100% confirmed the issue is from MMM-WallPaper but I have the exact same error. I’m running a pi3B, and I believe it’s showing through electron not via browser.
In my case I am setting my source to "/r/EarthPort+unitedstatesofamerica".
Any ideas?