-
Notifications
You must be signed in to change notification settings - Fork 154
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 - when running memory heavy python program #200
Comments
Try |
I used 2 times the value mentioned in the emscripten error. I put that here:
But the issue still occurs. I tried 10, 20 and 40 times memory. I don't think increasing the value any more will have some effect. |
Hi @Darker, it's possible you're encountering an error in the JIT backend, I've seen these cause out-of-memory errors in the past. You could try using the "nojit" release and see if you get the same problem: https://github.com/pypyjs/pypyjs/releases/download/v0.4.0/pypyjs-nojit-0.4.0.tar.gz (It will of course run slower without the JIT) |
Ok, I tried that version. It was indescribably slower but it still crashed. Same error. I need to emphasize that the algorithm is memory demanding. However, I am convinced it still should run, albeit slowly. I certainly made JS programs that consumed more memory, so the limitation is not in the javascript. |
Just thought I'd chime in on this since I have the same issue with a project I'm working on to parse files. Whats odd about it is that if I parse a smaller file and then attempt to parse a bigger file with the script it throws this error. However, if I parse a big file and then parse smaller files the issue doesn't occur. Its almost as if there is a size for something that is set initially and then locked after the first run. Not sure if this is helpful or not, I haven't dug into the pypyjs code base much, just a user and fan. |
So I decided to try how well does PyPyJS deal with some heavy code. In particular, it was Reversi AI that traverses state space of the game. State space based algorighms are typically CPU and memory demanding.
The program DID run for quite some while. Illustrational output:
This is where it fell. It already was predicting 4th level of state space. Funny thing this. It actually performs better than on ym home PC.
Anyway, the crash error was this:
It is my understanding that this error happens in emscripten. What can I do with the PyPyJS release to avoid the error. I don't mind increasing memory...
The main problem is that after this error occurs PyPyJS crashes completely. If I could at least set soft memory limit...
The sources to simulate this:
The reproduction steps:
pyweb
directoryhttp://127.0.0.1/pypy.html
in browser. Use new instance of browser in case of crashWelcome to PyPyJS!
execfile("/lib/pypyjs/lib_pypy/player.py")
by entering it in big text field and pressing EnterThe text was updated successfully, but these errors were encountered: