Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified in-memory caches #238

Open
brson opened this issue Jan 4, 2013 · 2 comments
Open

Unified in-memory caches #238

brson opened this issue Jan 4, 2013 · 2 comments
Labels
I-perf-bloat Unnecessary memory usage.

Comments

@brson
Copy link
Contributor

brson commented Jan 4, 2013

There are many caches all up and down the browser stack, for things like images, fonts, glyphs, text runs, and numerous unimagined future things. Additionally servo may have dual caches for any particular thing, one remote cache in a dedicated task and another task-local cache. As control over memory usage is critical in web browsers we should plan on making this robust from the outset. This is concerned with memory caches, not disk.

Implement a generic caching framework and replace all the existing caches.

Things to consider:

  • What strategies do we need for cache eviction? LRU-SP has been suggested as best-of-breed. Is it sufficient for all use cases?
  • There are scenarios (with image loading at least, maybe more in the future) where we first consult a task-local cache then, if the resource we want isn't available, ask another task for it, which in turn maintains its own cache. Do these two caches need to communicate?
  • In a low memory situation the browser should ideally be able to immediately free all unnecessary memory. This seems to imply some chain of communication between all caches and the OS. Consider though that it isn't simply enough to free memory at the language level - the allocator must actually return memory to the operating system. How do we do this?
  • Related to the above, some Linux kernels have features that allow the OS itself to discard application memory when it needs to (either ashmem on Android or the work-in-progress volatile pages patches). Integrating this in a comprehensive way could be a big win. At the least we can design our API's with these in mind.

Related: #51

@brson
Copy link
Contributor Author

brson commented Jan 8, 2013

Linux also has an upcoming feature for informing the client about general memory pressure, vmpressure_fd(): http://lwn.net/SubscriberLink/531077/d317d5bf9ab1855a/

@brson
Copy link
Contributor Author

brson commented May 16, 2013

Here's how the linux kernel's LRU cache shrinking subsystem is designed: https://lwn.net/Articles/550463/

ChrisParis pushed a commit to ChrisParis/servo that referenced this issue Sep 7, 2014
…on_document_address

Added test formAction_document_address.html
@jdm jdm added I-perf-bloat Unnecessary memory usage. and removed A-infrastructure labels Apr 12, 2016
jdm pushed a commit to jdm/servo that referenced this issue Mar 6, 2021
Throw type error on converting non objects to sequence

Fix for servo#237

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/238)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-perf-bloat Unnecessary memory usage.
Projects
None yet
Development

No branches or pull requests

2 participants