To check for how much memory is being allocated to java for the gateway, use the ps -efa | grep Gateway.jar | grep --color Xmx command.
The following configuration file has the multipication factor for the amount of memory. By default its 1/2
Change the multiplication factor to a higher number than 1/2. Example 2/3 or 4/5