FR: Allow specifying JVM flags for Java-based emulators
See original GitHub issue[REQUIRED] Environment info
firebase-tools: 8.6.0
Platform: Windows 10, Chrome 84.0.4147.105
[REQUIRED] Test case
I have no instructions to reproduce this issue, but I can describe the circumstances of it occurring
I have a large ruleset (around 60Ko) and many tests (200+) covering most of my ruleset.
When trying to visualize the report at http://localhost:8080/emulator/v1/projects/my-firebase-project:ruleCoverage I will get an error “sometimes”, the only solution is then to restart the emulator and hope it will work the next time.
It seems that the report generation in Chrome is exhausting the capabilities of my laptop…
[REQUIRED] Steps to reproduce
See above
[REQUIRED] Expected behavior
Report should be generated
[REQUIRED] Actual behavior
http://localhost:8080/emulator/v1/projects/my-firebase-project:ruleCoverage {“error”:{“code”:500,“message”:“Internal”,“status”:“INTERNAL”}}
firestore-debug.log Aug 04, 2020 9:52:10 AM io.gapi.emulators.netty.HttpHandler$1 onError INFO: Exception when handling request: Java heap space
How would I increase the “Java heap space” for the emulator?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:29 (14 by maintainers)
Thanks, @olivierkrener! I’ll repurpose this issue to track a better way to specify JVM flags in
firebase emulators:start
without having to dig out the jar.I’m not sure why but for me running the raw command
java -Xmx4g -Duser.language=en -jar /Users/peterm/.cache/firebase/emulators/cloud-firestore-emulator-v1.13.1.jar --host localhost --port 5050 --seed_from_export /Users/peterm/pathToMyBackupData/myBackupData.overall_export_metadata --rules /Users/peterm/pathToMyFirestoreRules/firestore.rules --functions_emulator localhost:5001 node /Users/peterm/.cache/firebase/emulators/ui-v1.6.0/server.bundle.js
didn’t do it. It said the Dev App Server was running but just couldn’t get the emulator UI to start working.
(Note1: tried “0.0.0.0” and “127.0.0.1” instead localhost as well. Note2: the port numbers above are reflected in my firebase.json file.)
But setting the java tool option to 4gigs in the environment variable did the trick:
export JAVA_TOOL_OPTIONS="-Xmx4g"
(on mac)So would definitely vote for adding this latter to the docs.