Something ain't right... Who ate all the RAM?..

Discussion in 'AnyStream' started by 0x0x0x0x0, Apr 28, 2021.

  1. 0x0x0x0x0

    0x0x0x0x0 Well-Known Member

    While doing something unrelated, with AS sitting idle while it's twiddling its thumbs waiting for tokens, I noticed that it's using up over 6GB of RAM on my 32GB RAM lappy (only downloading from prime with only that provider enabled)... while 101 Edge processes were eating up a measly (in comparison) 1.6GB. Surely that isn't the intended behaviour?..


    Can't upload the logfile: it's 133MB (forum backend says 68.4MB max)

    Edit: it looks like it might be "browsing the titles"-related: by just browsing through some titles, I managed to balloon AS to 1.2GB (logfile attached)

    Attached Files:

    Last edited: Apr 28, 2021
  2. Vzxy

    Vzxy Well-Known Member

    Just so that you're aware, many apps on Windows will eat up as much RAM as is available to it. I've noticed that AS gets really slow after a while if I don't relaunch it every so often. I am sure that it has to do with the amount of data being pushed around when browsing the Watchlist on AP due to to the thumbnails and descriptions. I can usually only grab a handful of titles before this becomes unbearable. Any applications that take up very little RAM have been designed to do specifically that.

    On Windows, half your RAM is dedicated to the OS and the other half to applications. Generally once all the application domain RAM has been used then page file swapping occurs and everything slows down even more. I also have 32gb RAM on one machine and AS will use a lot more RAM, because it's available, than my Core2 PC with only 4gb, which never goes above 2gb used at any time.

    This is not an excuse, but rather an explanation of how Windows handles RAM. Edge is developed by MS with billions of dollars to invest in making it as efficient as possible. AS is not trying to give you that sort of experience and can't likely afford to invest in making it run anywhere near as well as Edge, or even Chromium, so they dedicate their resources to working on issues that are key to the intended usage.

    That being said, I am not a fan of Qt on Windows... I think it's slow and clunky, so I've adjusted my expectations accordingly. Like I said before, no excuses, just reasons.
  3. DrXenos

    DrXenos Well-Known Member

    I completely disagree. Such behavior is indicative of either a poorly written program in a memory-managed language or memory leak in a non-managed one. Correctly written programs do not just gobble memory, relying on the page swapper to sort it out.

  4. Vzxy

    Vzxy Well-Known Member

    Then you would be wrong. Qt is not memory efficient on Windows.. Most cross-platform toolkits are not.
  5. DrXenos

    DrXenos Well-Known Member

    I seriously doubt I'm the one in the wrong. Your comments covered a lot more wrongness than just statements of Qt. No offense, but it shows an utter lack of understand of software development or the internals of Windows.

    Also, can I hazard a guess and say, you're running the 32-bit version on your Core 2 machine?
  6. Vzxy

    Vzxy Well-Known Member

    I've been developing apps for over 20 years. I understand Windows as well as most OSes fairly well. Not going to argue my point. It's ok to disagree, but youre still not accurate.
    DQ likes this.
  7. DrXenos

    DrXenos Well-Known Member

    I'm not going to get into a "measuring" contest with you, but I've been developing software since the early 70s. I've got children older than your years of experience. Regardless, your experience, number of degrees, et. al., has no bearing on the correctness of your assertions (appeal to authority fallacy).

    DQ likes this.
  8. 0x0x0x0x0

    0x0x0x0x0 Well-Known Member

    I wasn't planning on starting a philosophical debate, but here we are...

    Runaway memory consumption is never a good thing. It's one thing for kernel to eat up RAM for caches that can be dumped at any time there's memory pressure, it's entirely different for any application to gobble up memory in a mistaken belief it's the only thing running on the box and the user has no better use for that RAM. Same goes for relying on paging. In fact, I'd go as far as to say that there's only one serious use case for a VM pager in modern computers: memory-mapped file IO, and even that has its place.

    I know of only one platform where the applications are allowed to balloon (mostly because the ecosystem relies on inexperienced programmers flooding the market (no serious programmer would charge 99c for their program, updates, and support, for example)) and, even then, if the application doesn't respond to a request to relinquish its RAM in a meaningful way, it gets killed by the kernel.

    The whole "keep as many things in RAM as possible" dates back to the times when people used look-up tables to convert between ASCII and Base-64 en/de~coding, and it's not the way things are done for a long time (there is a nice paper, and a modern revision, at ACM about how many CPU cycles one needs to use up before storing the result in RAM for acceleration, but I can't find it at the whim)...

    But then again, I come from dependability/fault-tolerance background.

    PS: memory managed languages are a joke, I recall one vendor expressly recommending assigning null to an object if you wanted GC to release that memory...
    Last edited: Apr 28, 2021
  9. DQ

    DQ Well-Known Member

    Just agree to disagree guys. Even experienced folks can have differing opinions. No sense in whipping out the e-peens over it.
  10. DrXenos

    DrXenos Well-Known Member

    I completely agree. Most of my work (today, at least) is real-time systems. I avoid memory managed languages like the plague. I called them "code by number" (derivative of "paint by number").
    DQ likes this.
  11. Vzxy

    Vzxy Well-Known Member

    I agree with this which is why I said they dont have the resources to focus on optimizing memory handling when there are not only limited development resources, but the fact that you could simply restart the app.

    Ive coded in pascal, cobol, fortran amongst many others, including assembly. I know what memory management is. Any app using .NET clr is going to suffer these issues aside from Qt anyways, unless significant effort is made to remedy those specifically and that almost goes against the entire point of using .NET to begin with.
    DQ likes this.
  12. 0x0x0x0x0

    0x0x0x0x0 Well-Known Member

    I don't know what the problem is with the code, but I'm not entirely certain what you mean by "resources to focus on optimizing memory."

    Speaking generally, when I learnt coding (and that was the time when writing "interesting" TSR programs in assy was the coolest thing ever, especially if you can make it fit onto as few 5.25" floppy sectors as possible) the first thing you did before writing any code that uses allocated memory was to write a matching deallocating code, no different than putting down a closing brace as soon as you have put down an opening brace---these things just go together.

    Incidentally, it's a misconception that MS throws billions of dollars at Edge---the whole point of them switching to Edge and dropping IE was to save a lot of money, but that's a different story ;)
  13. DrXenos

    DrXenos Well-Known Member

    Sigh, I miss those days--when your computer was completely ours (nothing else running on it that you didn't expect). I once wrote a TSR to convert card-specific software ISR calls to VERA, because a game I bought only supported high res for 3 specific cards (none of which I had).
  14. Vzxy

    Vzxy Well-Known Member

    I wasnt suggest they throw billions at Edge, only that they basically have unlimited development resources, ie, tons of developers and billions to shell out on any project they desire. Edge was mostly moved to Chromium for compatiblity issues with existing sites once it became apparent that the market was not going to fragment.

    MS used to wear that shoe on the other foot when IE ruled and everyone was rushing to make their browsers compatible with IE. Only there were no common frameworks to choose from back then to just spin up your own version of a browser like there is today. MS is famous for wasting cash beating their heads against to wall to force adoption of their proprietary tech, but that's not going to work anymore, so if you cant beat em, join em. Same thing goes with WSL, couldnt force people not to just not use Linux so they now have their own distro built into Windows to try to keep all these new developers from jumping ship.

    My point with limited development resources means, both cash and manpower. AS is surely limited on both these fronts and focusing on accomplishing the actual task of downloading a useable file is tantamount over trying to have the best memory management possible.
  15. DrXenos

    DrXenos Well-Known Member

    I'm still not understanding why you think proper resource management in software take oodles of money and time. It is a basic skill that ALL software develops should master, and apply throughout a project, and not when you've got "money and/or time." This is one of the reasons I seriously hate languages like Java, C#, Python, etc. al. They are killing the development of proper skills. People just creates gobs of object and think, "no big deal. the garbage collector will take care of it!"
  16. Vzxy

    Vzxy Well-Known Member

    I am not fond of them either but I face this same mentality from elitist musicians that I play with. They think that just because Kurt Cobain has lousy technique that his output wasn't effective. Also, guitarists are famous for thinking that if you don't play the same guitars they're playing -using the exact same technique- you're simply wasting your time.

    If you think its that easy, then why didn't you whip up your own AS alternative this morning and school us all in the values of coder elitism. No question mark there since its rhetorical.
    Last edited: Apr 28, 2021
  17. DrXenos

    DrXenos Well-Known Member

    I didn't say it was easy. I said it was a fundamental skill, and something that should be done throughout the lifetime of software, not at the end.

    Also, I seriously doubt the developers of AS haven't done proper developement. If I were to hazard a guess, I would say it's just a bug.
  18. Vzxy

    Vzxy Well-Known Member

    Well, I guess we should've all just sat on our thumbs and waited for AS to get everything exactly perfect, to your standards, before we started downloading things we wanted yesterday. That sounds like a great and profitable business model, especially since most paying users couldn't care less about what's happening under the hood as long as they can have Stranger Things on their laptop now.
  19. DrXenos

    DrXenos Well-Known Member

    I've not sure what you're going on about. You're creating a straw man. I never once said software must be bug-free. Such a thing is impossible except for the most trivial of programs.
  20. RedFox 1

    RedFox 1 Super Moderator

    I cannot reproduce any of these memory issues, probably a reboot would have fixed the issue, and it wouldn't have happened again. Could be an operating system error, who knows with no log.