Search code examples
javawindowsgrailsheap-memoryheap-size

Windows - Where to locate .bashrc file to increase heap size


Actually I'm working on grails application which running smothly but after some time its throwing exception: java.lang.OutOfMemoryError: Java heap space for this i received some solutions like

  1. Adding Env. Variable GRAILS_OPTS = -server -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m even tried GRAILS_OPTS = -Xms512m -Xmx1024m

  2. Adding variable JAVA_OPTS=-Xmx1024m -XX:MaxPermSize=96m to startGrails.bat file

  3. is adding export GRAILS_OPTS="-Xms1g -Xmx1g -server" in .bashrc file can anyone tell me where is this file located.

No luck with option 1 and 2.

Using Windows 10


Solution

  • bash man page:

    When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of ~/.bashrc.

    It is a hidden file (note dot as a first char) so please open it in the terminal with this command (if you are using gedit ofc): sudo gedit ~/.bashrc

    update: however after reading your question once again i think that you are working on Windows and your option 3 is a linux alternative to #1. isn't it?