First off, quick note: editing starsector.bat only works if you're using starsector.bat to launch the game, rather than the exe. If you're using starsector.exe, there's a vmparams file in the <Installed Folder>. It's got no extension but is a text file with the same values as the .bat.
As far as the crash: there's a bug (which
should be fixed in the dev version) that leads to a memory leak every time there's a new background loaded or a new screenshot taken. It doesn't make sense that it would happen for you in the first battle, though, but if Exerelin loads *that* much stuff...
Well, regardless, I'd make the edits FloW suggested, but in the vmparams file - should help. Except change the values to something higher; setting both to 2048 should be good.
I'll just go ahead and suggest something that Alex sometimes does when OoM-Errors show up:
....
(Btw: this can be a fix when the .exe fails to work for mysterious reasons. I've already updated the .bat so the edits (to sync it up with what's in vmparams) are no longer necessary. Still trying to work out why the exe refuses to run on a few systems, though.)