sql-js / sql-js/sql.js

Bug: Out of memory if reloading the page excessively

Open
#574 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Hi, i noticed after using this awesome library, that if you reload a webpage containing this library over and over again it will consume increasingly more RAM. I'd guess that there are some resources that aren't freed on page reload, i can reliably reproduce this behaviour on the official demo site (https://sql.js.org/examples/GUI/)
here is a screenshot of the chrome performance monitor
image

as you can see, each time i reload the page some memory is allocated in the js heap that isn't being freed afterwards. i am not really sure if this is more of a chrome type bug or a bug from webassembly. it's also possible i overread something in the documentation how to properly handle deallocation of each wasm instance...

i've hit tab out of memory exceptions multiple times while developing a page with this library, but i dont think this is a particular high priority issue as it only happens if you EXCESSIVELY reload a webpage. i'd still though i should report this

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the memory growth on the official demo site at https://sql.js.org/examples/GUI/ while monitoring Chrome's performance data. Read the documentation about deallocating WebAssembly instances and trace what survives repeated page reloads. Done means repeated reloads no longer cause steadily increasing JavaScript heap usage or tab-out-of-memory failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sqlite, wasm
Domain
databases, performance, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.