You may need to override toString
on any recursive or deeply-nested data structure, since IntelliJ will ask the Java Debugger (JDB) to call toString all the time.
This will blow up your memory.
Useful for any number of reasons: testing on a different OS, using lots of memory/cpu resources you don't have locally, etc.
See an Intellij / IDEA guide for background.
Edit remote build.sbt to include no forking in Test, e.g.:
settings(
fork in Test := false,
//...
Then you can run from the command line:
JAVA_OPTS="-Xms2G -Xmx180G -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8600" sbt
If you don't use Linux locally, see above for remote debugging guide. Note that due to a partially broken feature in SBT, YMMV with this method. You will need sudo privileges on the Linux system to use this method, though there are workarounds and alternatives like lxc-usernsexec
.
Start up a shell without network access (all children will inherit the same lack of network access):
sudo unshare -n su - <myUserName>
You can verify networking is not working:
sbt "set offline := true" 'eval "ping 127.0.0.1" !'
Run your desired test in SBT with offline mode enabled:
JAVA_OPTS="-Xms2G -Xmx180G" sbt "set offline := true" 'testOnly edu.ncrn.cornell.xml.DdiCodebookSpec'