How to update the Java heap size and total memory size displayed under system info of crucible
Asked by Ramya Yarru:

How to update the Java heap size and total memory size displayed under system info of crucible.

I Sorted it by simply adding the parameters in the FISHEYE_CMD string instead:

FISHEYE_CMD="$JAVACMD $FISHEYE_OPTS -Xms4096m -Xmx8192m -Dfisheye.library.path

but it displays both 1024MB and 2048MB and total memory also shows as 10.24MB.


Answers:
author: Evan Slaughter
body: Hey [@Ramya Yarru](/t5/user/viewprofilepage/user-id/3797301) - you should be able to control the amount of memory allocated to the Fisheye/Crucible JVM by using the $FISHEYE_OPTS environment variable. If you edit the JVM arguments anywhere else, it's possible that there could be some memory arguments that are being passed in earlier in the arguments which are overwriting the ones you're setting elsewhere.

* You should be able to see the JVM and all of its included arguments by running a command akin to the following:

  *

    ```
    ps -aux | grep java
    ```

For more info on tuning the Fisheye JVM, I recommend checking out [this knowledge article](https://confluence.atlassian.com/fishkb/fix-out-of-memory-errors-165609660.html) as it serves to address all of the different kinds of situations where your team may be looking to configure these heap values.

Hope this helps!

Thanks,

Evan Slaughter

comments: author: Ramya Yarru
body: Thanks for replying Evan.

So basically from your answer do you mean that i must change FISHEYE_OPTS environment variable in fisheyectl.sh file?

I currently have the below assigned to it:

FISHEYE_OPTS =\`$JAVACMD -cp $FISHEYE_HOME/fisheyeboot.jar com.cenqua.fisheye.boot.OptsSetter\`

So should i remove the whole thing and override it by the below?

FISHEYE_OPTS=\`-Xmx4096m\`

but i have tried the above (removing the whole thing assigned to FISHEYE_OPTS and replacing by memory size) and i see the below in JVM argument wherein memory itself is not being reflected, please advise:

ps -aux \| grep java  
crucible 30086 95.5 13.9 3194112 543048 ? Sl 05:06 1:43 /usr/bin/java -Dfisheye.library.path= -Dfisheye.inst=/apps/crucible -Djava.awt.headless=true -Djava.endorsed.dirs=/apps/fecru-4.8.0/lib/endorsed -jar /apps/fecru-4.8.0/fisheyeboot.jar start  


author: Evan Slaughter
body: You would not want to edit this value in your fisheyectl.sh file. Instead, you need to set the appropriate value for this in the actual environment variable for the user being used to run Fisheye.

For more information on these environment variables, and how you can set them in both Linux and Windows environments, you'll want to check out [this knowledge article on environment variables in Fisheye.](https://confluence.atlassian.com/fisheye/environment-variables-960155682.html#Environmentvariables-SettingenvironmentvariablesunderLinuxorMac)

For example, if I append the following to the bottom of my /etc/profile file:

```
FISHEYE_OPTS="-Xms128m -Xmx1024m"
export FISHEYE_OPTS
```

I can then see that when I restart Fisheye, that the environment variable was picked up and these JVM argument were appropriately added in:

![2020-03-19_17h42_01.png](https://community.atlassian.com/t5/image/serverpage/image-id/87269i99DEA7FD24124B2A/image-size/large?v=v2&px=999 "2020-03-19_17h42_01.png")Hope this helps expand on this information.

Thanks,

Evan Slaughter


author: Ramya Yarru
body: Thanks Evan, i have tried exactly what you said but no luck :(

added the below in /etc/profile file to the bottom,restarted service but still i could see 1024m.

FISHEYE_OPTS="-Xms128m -Xmx1536m"  
export FISHEYE_OPTS

ps -aux \| grep java  
crucible 5165 98.7 11.9 3210520 464200 ? Sl 04:35 1:20 /usr/bin/java -Xmx1024m -Dfisheye.library.path= -Dfisheye.inst=/apps/crucible -Djava.awt.headless=true -Djava.endorsed.dirs=/apps/fecru-4.8.0/lib/endorsed -jar /apps/fecru-4.8.0/fisheyeboot.jar start  
root 5423 0.0 0.0 115496 1308 pts/1 R+ 04:37 0:00 grep --color=auto java

I then modified and added export FISHEYE_OPTS="-Xmx1536m" to /etc/profile file which is actually the same and restarted the server, service and also opened a new shell but no luck.


author: Jim Butler
body: Assuming you are running as user 'crucible', then put these values in the /home/crucible/.bashrc

becume user crucible (either: login or su - crucible) \[use the - {dash} because the dash will source the files, using su without the dash just becomes the user crucible but does not pull in ANY environment variables)

export FISHEYE_OPTS="-Xms256m -Xmx2048m" for example, or the two line solution above.

then source it: (again, or logout/in as crucible.)

i.e., ' source /home/crucible/.bashrc'

Use the env command to check

env \| grep -i Fish - you should see the env's.

then stop and start crucible.