If you happen to casually peruse the Grails documentation, you might notice the following note regarding memory (please note, man, that the emphasis has been added by yours truly):
If memory is not a problem on your server then allocate a large amount of memory, such as 512M or more. Also use the server VM option. EG: (-server -Xms512M -Xmx512M). Usually it is better to set both min and max heap size to the same in server applications.
Accordingly, if you’re using Tomcat (and you’d like to allocate a lot of memory), you can edit the catalina.(bin | sh) file found in the bin directory of your Tomcat installation.
For example, on a Windows machine (where I currently find myself these days), I added the following statement around line 71:
set JAVA_OPTS=%JAVA_OPTS% -server -Xms512M -Xmx512M
Incidentally, non-scientific testing of perceived performance before and after the changes listed above resulted in an extremely noticeable speed up in processing of a high volume of RESTful requests. It seems like the above note from Grails is good advice; plus, adding the -server option is a good idea in general due to the HotSpot VM’s ability to selectively compile heavily used code.
