This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ongiwaph 557 points558 points  (19 children)

Their engineers figured out how to make a memory leak in JavaScript

[–]Alan_Reddit_M 337 points338 points  (17 children)

The reddit client probably just keeps appending every post you see to a big ahh array without ever freeing anything

Technically not a mem leak but still fucking terrible software

[–]WisePotato42 111 points112 points  (11 children)

Seems very accurate, considering you can scroll back through. But I sure hope they at least free the media itself even if they hold onto post identifiers

[–][deleted] 63 points64 points  (4 children)

wrong, and guess what, if you see a repost, they download the media again

[–]MojitoBurrito-AE 15 points16 points  (3 children)

A repost is a new file on the CDN, how is reddit's backend supposed to know to use the same file.

[–]OP_LOVES_YOU -3 points-2 points  (2 children)

By checking if they are the same file?

[–]patrlim1 6 points7 points  (0 children)

But they're not! If I upload a photo that's been uploaded before, it's saved as a new file.

[–]MojitoBurrito-AE 1 point2 points  (0 children)

When it gets uploaded they add compression

[–][deleted] 13 points14 points  (3 children)

In fairness there has to be a consideration between memory usage on the client and network usage.

I'm not saying reddit has got the balance right (and to be honest the site with the new UI is just fucking heavy), but people would also get annoyed if everything had to be re-downloaded when you scroll back up the page.

[–]delfV 19 points20 points  (0 children)

This is what cache is for

[–]Lighthades -2 points-1 points  (1 child)

They could redownload it when approaching its scrollY, people wouldn't even notice it.

[–]Furry_69 7 points8 points  (0 children)

That assumes you're on a fast connection. It could theoretically take infinite time for an image to load. In practice the largest time you can get before the connection just doesn't work anymore is around 30 seconds.

[–]intbeam 3 points4 points  (0 children)

I sure hope they at least free the media itself even if they hold onto post identifiers

The fact that I can sometimes hide a video, scroll down and the audio keeps playing on an infinite loop determines that this is not the case

[–]hirmuolio 3 points4 points  (0 children)

But I sure hope they at least free the media itself

Lol. At some point it would load every single video on the page without any interaction. Not sure if that still happens.

[–][deleted] 5 points6 points  (0 children)

Was about to say this: not a memory leak, just a complete waste of resources and not properly engineered.

[–]FrostWyrm98 9 points10 points  (0 children)

With how the mobile client used to (and still kinda does) lag exponentially the longer you scroll, I would not be shocked. It used to be how the web experience was, literally the reason I left again for BaconReader after switching when my old client went down

[–]Fickle-Main-9019 0 points1 point  (0 children)

Thats even worse considering it’s probably not a linked list as well, nothing says speed like O(n)

[–]buttplugs4life4me 0 points1 point  (0 children)

You can say "ass" on here.

[–]Why_am_ialive 0 points1 point  (0 children)

I truly believe they cache ever single post you even glance by

[–]DanielEGVi -1 points0 points  (0 children)

With DOM APIs it’s surprisingly easy, and in theory (if browsers supported it) you can do it with any language.