So after last time, I thought I’d given ElectroServer more memory, but it turns out I hadn’t. I’m not exactly sure why, but I suspect it’s something about how Media Temple is set up.
So rather than call the main ElectroServer app (which is just a shell script), I’m opening the ElectroServer jar file, and that way I can tell java how much memory to use (and other options) as parameters.
I’m pretty sure Java is installed somewhere on Media Temple (you need to install the dev tools) but I couldn’t find it anywhere! And if I just typed java it couldn’t find it. I even ran a find command, but it was nowhere! But then I realised that the Java runtime is packaged with ElectroServer in the jre folder!
So with a bit of fiddling I worked out that I could start ElectroServer with more memory by running the jar file, but I had to do it while in the server subfolder within the ES install.
../jre/bin/java -Xmx128M -jar lib/ElectroServer4-bootstrap.jar -mode StandAlone -config config/ES4Configuration.xml
where 128M is the amount of RAM made available.
There is a better way! Thanks to Paul Hayes (a colleague at Plug-in Media, see comments below) I have now realised that ElectroServer’s main app is nothing more than a shell script that you can edit. Furthermore there is a line you can uncomment right at the top to change the Java parameters :
# Uncomment the following line to add additional VM parameters # INSTALL4J_ADD_VM_PARAMS=
Change this to :
# Uncomment the following line to add additional VM parameters INSTALL4J_ADD_VM_PARAMS="-Xmx512m"
Where 512 is the amount of RAM in Mb you want ElectroServer to use.
11 replies on “Giving ElectroServer more memory”
Just a thought – have you considered asking people who know about this stuff before wasting inordinate amounts of time on it?
I like to learn things for myself, if I have people to hand who are experts I will seek their help. I haven’t wasted “inordinate amounts of time”, just the odd hour or two here and there while I’m doing other things.
I guess I hoped that other people who also have my background may benefit from my experiences but if that’s not the case, let me know and I’ll stop sharing them with you!
good writing , thanks
My point was that a whole bunch of people rely on you to get an understanding of the subjects you are an expert in, and you can probably rely on your audience for an understandable explanation of things like this which you’re not yet an expert in.
I’m sorry if I sounded defensive before, I shouldn’t write replies so late at night 🙂 I do rely on my audience for help, but I can’t engage them in conversation unless I post about my experiences. Having said that, I have been documenting the process here because I hoped it would be helpful, but it may be better if I just waited until I had it all worked out and then shared.
I’d be very interested to hear what other people thought too – is the journey worth sharing or are you only interested in the final analysis?
[…] / Guides « Predicting circle line collisions Giving ElectroServer more memory […]
SWEET! I did some Electroserver work a year ago and have been planning to dive back into it. I’ll be looking forward to what you discover along the way.
Coincidently I had to do the same thing to Eclipse last week as the Flex plugin was eating all the allocated memory eclipse had, causing it to die.
/opt/eclipse/eclipse -vmargs -Xmx512m
Thanks Paul, that explains a LOT! I’ll try this out on the Media Temple later. I guess I should probably ask you about these things first, huh? 😉
I discovered alternative way of running electroserver permanently with a larger amount of memory by editing the file ElectroServer (it’s just a shell script): Uncomment the following line:
and change it to
That worked perfectly! Post has been updated. Thanks again Paul!