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

Exceed Max Memory with too much cards #39

Closed
daniel-vera-g opened this issue Dec 15, 2021 · 2 comments
Closed

Exceed Max Memory with too much cards #39

daniel-vera-g opened this issue Dec 15, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@daniel-vera-g
Copy link
Contributor

I was using a Deck with a little bit more of content and a higher number of cards.
By trying to compile, I would get a Memory issue:

➜ md2apkg -i test.md
found 71 cards!
writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!
deck initialized!
Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0
Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile w
ith  -s ABORTING_MALLOC=0

Test

To test, use my attached file and use the md2apkg package: npm init -y && npm i md2apkg && npx md2apkg -i test.md

test.md

Workaround/Fix

The issue comes from the anki-pkg-export package.

I saw, that there was a comment with a way to probably fix this: repeat-space/anki-apkg-export#25 (comment) and that you're currently also maintaining the anki-apkg-export fork for this package. Would it be possible to implement the proposed change in md2apkg ?

Currently I'm using this as a workaround. Nevertheless, that's clearly not the solution as people using this package don't know about this upstream Issue 😅

@Steve2955 Steve2955 added the bug Something isn't working label Jan 13, 2022
@Steve2955 Steve2955 self-assigned this Jan 13, 2022
@Steve2955
Copy link
Owner

Steve2955 commented Jan 13, 2022

@daniel-vera-g Thank you very much for pointing out this issue. Your provided example file didn't cause any issues for me at first, but after appending the file a few times to itself the error showed up. I pushed a fix to my fork of anki-apkg-export. No changes to md2apkg were required.

Sorry for taking a few weeks to do this, I've been a bit busy lately. Let me know if this fixed your issue. :)

@daniel-vera-g
Copy link
Contributor Author

Fixed it, thanks.
Closing it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants