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

Cannot enlarge memory arrays - Possible to modify sql.js file? #25

Closed
duffrind opened this issue Jul 25, 2017 · 2 comments
Closed

Cannot enlarge memory arrays - Possible to modify sql.js file? #25

duffrind opened this issue Jul 25, 2017 · 2 comments

Comments

@duffrind
Copy link

Hello,

I attempted to use anki-apkg-export to generate 861 cards, but am reaching the memory limit before they are all added.

The final apkg file is 87KB so I don't know why I am hitting the current ~18MB limit that sql.js has. Regardless, I am wondering if I would be able to either:

  • have anki-apkg-export use a custom sql.js that is compiled to have a TOTAL_MEMORY of 512MB

  • have anki-apkg-export use sql-memory-growth.js instead of sql.js without modifying the dist/index.js file directly

Enlarging the arrays adds overhead that doubles the execution time when compared to increasing the TOTAL_MEMORY, so I would prefer the first option.

I am new to nodejs so perhaps I am off-topic and this is possible with yarn scripts.

Thanks,
David

@duffrind
Copy link
Author

duffrind commented Jul 25, 2017

After searching around I realized that all I must do is append Module = { TOTAL_MEMORY: 536870912 }; to my js file before I require anki-apkg-export

@ewnd9
Copy link
Member

ewnd9 commented Jul 25, 2017

Hi, thanks for the valuable information, I put a link to this issue in README.

In regard of custom sql.js: take a look at https://github.com/ewnd9/anki-apkg-export/blob/master/src/index.js

You can require anki-apkg-export/dist/exporter and manually pass custom sql.js and an sql template to it.

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

No branches or pull requests

2 participants