Optional heap and permgen args for java VM #1

Merged
merged 2 commits into from Apr 8, 2013

Conversation

Projects
None yet
2 participants
Contributor

toolbear commented Apr 4, 2013

Allow optional $jenkins_max_heap_size and $jenkins_max_perm_size vars to control heap and permgen sizes in Jenkins Java VM via java command line args.

Usage:

$jenkins_max_heap_size = "6G"
$jenkins_max_perm_size = "512M"
include jenkins

Both variables are optional. Arguments to java are only added if the corresponding variable is set.

Owner

bilke commented Apr 4, 2013

Thanks for your contribution! I tried a few things but I also was not able to set the variables (I am a puppet noob in fact...).

Contributor

toolbear commented Apr 4, 2013

Noob also. I'll see if I can get help on IRC. Also reading puppet tutorial and have one more idea to try. If I figure it out, I'll update and re-open this PR.

toolbear closed this Apr 4, 2013

toolbear reopened this Apr 7, 2013

Contributor

toolbear commented Apr 7, 2013

Figured it out. Updated the PR.

@bilke bilke added a commit that referenced this pull request Apr 8, 2013

@bilke bilke Merge pull request #1 from detroit-labs/java-memory-config
Optional heap and permgen args for java VM
b104022

@bilke bilke merged commit b104022 into bilke:master Apr 8, 2013

Owner

bilke commented Apr 8, 2013

@toolbear Where do you define the variables? For me they seem to be out of scope in config.pp (with a value of undef) no matter where I define them (I tried in my personal config under modules/people/manifests and also in manifests/site.pp).

Contributor

toolbear commented Apr 11, 2013

Sorry for late reply. I noticed that it was merged, but missed your comment asking about it.

For me, defining them in a node block in manifests/site.pp works:

node 'vendacious.local' {
  # core modules, needed for most things
  include dnsmasq
  …

  # jenkins
  $jenkins_max_heap_size = "6G"
  $jenkins_max_perm_size = "512M"
  include java
  include jenkins

  …
}

The values had to be assigned prior to include jenkins. I didn't try setting them in modules/people/manifests. My (limited) understanding of variable scoping in puppet is that these have to be defined in the block, or containing block, of the include jenkins for it to work.

I'm not particularly pleased how this works, but that it works at all is a step forward, I feel.

Owner

bilke commented Apr 11, 2013

Yes I also assigned the values prior to include jenkins.

Thanks, defining it in a node block works for me too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment