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

Use SD card as swapfile #62

Closed
gfwilliams opened this issue Oct 1, 2013 · 5 comments
Closed

Use SD card as swapfile #62

gfwilliams opened this issue Oct 1, 2013 · 5 comments

Comments

@gfwilliams
Copy link
Member

gfwilliams commented Oct 1, 2013

Espruino's fixed-size JsVar blocks were designed for this, but it was never implemented.

You'd have to change jsVarCache, jsvLock and jsvUnLock, and then store only the most-used (and locked) JsVars in RAM - writing the rest onto the SD card. Probably quite a lot of work, but it'd be epic.

It would kill Garbage Collection speed (it might need a re-write?) but then if you had basically infinite memory that's not a huge issue.

@gfwilliams
Copy link
Member Author

gfwilliams commented Dec 20, 2015

There's a branch that does this here:

https://github.com/espruino/Espruino/tree/variable_cache

It's still far from perfect:

  • it's only built for linux
  • the 'backing' data is just stored in a var called variables, and isn't written to a file
  • it does crash running some tests

But it proves that it can be done - and without hacking everything around so much that it doesn't run on 'normal' devices.

@gfwilliams
Copy link
Member Author

gfwilliams commented Apr 9, 2016

related comment here: #817 (comment)

@tve
Copy link
Contributor

tve commented May 7, 2016

it does crash running some tests
Do you recall what crashed?

@gfwilliams
Copy link
Member Author

gfwilliams commented May 9, 2016

No... but building for linux and doing ./espruino --test-all might show it up.

I can't remember if this branch needs it, but you might want to edit build_platform_config and remove the RESIZABLE_JSVARS line.

@gfwilliams
Copy link
Member Author

gfwilliams commented Aug 7, 2018

Killing this due to lack of interest - I guess variable_cache might still happen but honestly it's so easy to find boards with decent amounts of RAM/ROM built in now this isn't a big deal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants