Alex F
Alex F

Reputation: 896

Why are modern apps using so much RSS even with few data?

On mac for instance:

Why do text editors use 30MB RSS just for a text pane, less than 1K chars, open/save, find/replace and a few other basic functions ? They were using way less a few years before, while their functionality did not change.

Why is Firefox using 500~1000MB rss when you browse a few webpages of a few hundreds KB each ? Why does it uses 300~500MB just to startup, even with no addon ?

Why does Safari acts the same, even if it is supposed to be using cocoa libraries which should be shared and in VSZ and not RSS ?

Upvotes: 1

Views: 74

Answers (1)

Nickolay
Nickolay

Reputation: 32063

There are many answers to this and I'm procrastinating, so here it goes :)

  • For better or for worse, the system requirements of software increase because those developing it feel that more hardware resources are available to the typical user of their software. This means:
    • Less development resources can be spent on fine-tuning (e.g. using higher-level programming frameworks, spending less developer time on optimizing resource usage vs implementing new features and fixing behavior bugs).
    • New features can be added to the software (I don't know about text editors, but you'd probably be surprised if someone counted the number of new web platform features browsers added support for during the last few years.)
    • Different memory/performance tradeoffs can be made (i.e. caching more stuff in memory)
  • Memory usage of simple apps on Mac - see Why do Cocoa apps use so much memory? . Basically, your understanding of Resident set size is quite simplistic.
  • Browsers' memory usage
    • Memory usage mainly depends on the content the browsers have to display. You might think you have a "few hundred kb" page loaded, when in fact a typical web page is an application with code for handling or tracking your clicks, a few sub-applications (one for each "like" and "+1" button, or for ads), with another application for the flash applet embedded on the page, etc.
    • Software is hard, and browsers are very complex in particular (e.g. Firefox has more than 9M lines of code according to ohloh). So an easy optimization can cost a lot more than you might think.
      A recent example I've seen (681201): when you restart Firefox and it's set to not load the pages in tabs before you switch to a tab, each "empty" tab still uses several hundreds of KB. This is because every "empty" tab actually has a blank HTML document loaded into it and a full-featured JavaScript environment set up, ready to execute code.
      Seems easy to fix (just don't create a blank document for empty tabs!), but changing this requires auditing much of the browser code that works with tabs to properly handle the "empty tab" case, and worse, requires changes to add-ons that depend on every tab having a document. So while gradual improvements are being made (down to 160K per tab from more than a megabyte), it's not as easy as it sounds.

Upvotes: 1

Related Questions