Increase JVM Memory on a server

Good evening.

How would one increase the JVM Memory settings of a server.

The equivalent of: -Xms1024m -Xmx1024m -XX:MaxPermSize=256m

Kind regards
– mat

Edit the ServerService and add your JVM args to line 159 :slight_smile:

For example:

var args = " -Xmx1024m -javaagent:""#libdir#/lucee-inst.jar"" -jar “”#variables.jarPath#"""

I have a ticket to allow for this property but in the mean time this will work around it. I did this on my CFML Pi blog:

http://pi.bradwood.com/

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Perfect. Most appreciated.

Brad,

How does one go about contributing to CommandBox? I’d like to submit a pull request that implements the ability to provide custom JVM args to the box server start command.

Hi, I’m glad you’re interested in contributing to CommandBox!

FIrst of all, I’d like to point out that the bleeding edge of CommandBox already has an argument called “heapSize” to will set the max heap size for your server instance.

start heapSize=512

You download the bleeding edge of CommandBox from our integration server:
http://integration.stg.ortussolutions.com/artifacts/ortussolutions/commandbox/2.1.0/

Just download the new binary and replace the old one on your file system. It will install the first time you run it.

You can experiment with changes to the cfml code easily by modifying the contents of ~/.CommandBox/cfml/ on your drive and reloading the shell with the “reload” command. On my PC, I use a symlink to point the CFML directory of my CommandBox install to the src/cfml/ directory of my Git checkout of the CommandBox code. That way I don’t have to build and reinstall for every change and I can commit/push and pull changes straight into my local CommandBox install via Git.

I run the following commands after installing CommandBox (Windows 7) to do this. Obviously, the paths will be different on your computer.

rd /S /Q C:\Users\Brad.development.CommandBox\cfml
mklink /D C:\Users\Brad.development.CommandBox\cfml C:\Users\Brad.development\Documents\GitHub\box-cli\src\cfml

Note, you’ll need to keep the .version file in your cfml directory so the binary doesn’t try to auto-upgrade the next time it’s run.

  1. Fork the main CommandBox sources from here (at least the CF portions)
    https://github.com/Ortus-Solutions/commandbox
  2. Clone your fork locally
  3. Checkout the development branch
  4. Set up the symlink trick explained above (optional)
  5. Make sure there is a ticket in JIRA for what you’d like to change. Here is the ticket ad-hoc JVM args:
    https://ortussolutions.atlassian.net/browse/COMMANDBOX-250
  6. Make your desired changes
  7. Commit/push to your fork/branch
  8. Create a pull request on the GitHub website to our development branch

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com