Not possible to free memory used by WASM (without using a web worker)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- javascript, sqlite, wasm
- Domaine
- databases
Piste de recherche
Locate initSqlJsPromise and moduleConfig in the JavaScript initialization code, then trace how the WASM instance is retained after initSqlJs() resolves. Review the existing reuse behavior and determine how an opt-out release mechanism should behave; done means the configured path no longer retains the unused WASM memory while normal repeated initialization remains supported.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
It is desirable to be able to free up the 20MB+ allocated to the sql.js WASM in the JavaScript heap if this is only used for initial loading of data. This is not currently possible because the var initSqlJsPromise is held in a closure within the module and there is also no way to assign "undefined" to it once is no longer required (which would allow garbage collection to reclaim the memory). Although I can understand the desire to re-use the existing WASM if initSqlJs() is called more than once, the comment in the existing code hints at the undesirability of implementing it this way:
// TODO: Make this not declare a global if used in the browser
var initSqlJsPromise = undefined;
One solution (assuming exporting an additional function freeSqlJs() is problematic) would be to add a property in moduleConfig to optionally not hold a reference to initSqlJsPromise after initSqlJs() returns it.
- Langage dominant
- JavaScript
- Étoiles
- 13.7k
- Forks
- 1.1k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de sql-js/sql.js
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Add the WebWorker API docs Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
Toutes les issues de sql-js/sql.js
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
avniproject/avni-client#2135 ·
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
bevyengine/bevy-website#2595 ·
-
ecosystem wording
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
matrix-org/matrix.org#3649 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
vadimdemedes/ink#1029 ·