Skip to content

Commit

Permalink
Add IgnoreUnrecognizedVMOptions flag
Browse files Browse the repository at this point in the history
Our use of MaxPermSize has led to a number of warnings
in Java8 about the removal of that option. To prevent
these warnings, this adds another flag to ignore unknown
flags....
  • Loading branch information
joshmoore committed May 20, 2015
1 parent 595394e commit 83718b0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 18 deletions.
6 changes: 5 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def find_java():


def calculate_memory_args():
return "-Xmx600M -XX:MaxPermSize=256m".split(" ")
return (
"-Xmx600M",
"-XX:MaxPermSize=256m",
"-XX:+IgnoreUnrecognizedVMOptions"
)


def handle_tools(args):
Expand Down
1 change: 1 addition & 0 deletions components/antlib/resources/lifecycle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ omero.version=${omero.version}
<pathelement location="${test.dir}"/>
</classpath>
<jvmarg value="-XX:MaxPermSize=256m"/>
<jvmarg value="-XX:+IgnoreUnrecognizedVMOptions"/>
<jvmarg value="-Dlogback.configuration=logback-build.xml"/>
<jvmarg value="-Domero.db.name=${omero.db.name}"/>
<jvmarg value="-Domero.db.host=${omero.db.host}"/>
Expand Down
2 changes: 2 additions & 0 deletions components/tools/OmeroPy/src/omero/install/jvmcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ def get_memory_settings(self):
self.get_heap_dump(),
self.get_perm_gen(),
]
if any([x.startswith("-XX:MaxPermSize") for x in values]):
values.append("-XX:+IgnoreUnrecognizedVMOptions")
values += self.get_append()
return [x for x in values if x]

Expand Down
1 change: 1 addition & 0 deletions components/tools/OmeroPy/test/unit/old_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
See #4670
-->
<option>-XX:MaxPermSize=128m</option>
<option>-XX:+IgnoreUnrecognizedVMOptions</option>
<target name="memcfg">
<option>${omero.blitz.maxmemory}</option>
<option>${omero.blitz.permgen}</option>
Expand Down
53 changes: 36 additions & 17 deletions components/tools/OmeroPy/test/unit/test_jvmcfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"blitz" : [
"-Xmx512m",
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions",
"foo",
"bar"
]
Expand All @@ -22,7 +23,8 @@
"output": {
"blitz" : [
"-Xmx512m",
"-XX:MaxPermSize=128m"
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -35,7 +37,8 @@
"output": {
"blitz" : [
"-Xmx1G",
"-XX:MaxPermSize=128m"
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -49,7 +52,8 @@
"blitz" : [
"-Xmx512m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:MaxPermSize=128m"
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -62,7 +66,8 @@
"output": {
"blitz" : [
"-Xmx512m",
"-XX:MaxPermSize=1G"
"-XX:MaxPermSize=1G",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -75,7 +80,8 @@
"output": {
"blitz" : [
"-Xmx512m",
"-XX:MaxPermSize=256m"
"-XX:MaxPermSize=256m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -89,7 +95,8 @@
"output": {
"blitz" : [
"-Xmx150m",
"-XX:MaxPermSize=128m"
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -102,7 +109,8 @@
"output": {
"blitz" : [
"-Xmx600m",
"-XX:MaxPermSize=256m"
"-XX:MaxPermSize=256m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -115,7 +123,8 @@
"output": {
"blitz" : [
"-Xmx1200m",
"-XX:MaxPermSize=512m"
"-XX:MaxPermSize=512m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -128,7 +137,8 @@
"output": {
"blitz" : [
"-Xmx3600m",
"-XX:MaxPermSize=1g"
"-XX:MaxPermSize=1g",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -141,7 +151,8 @@
"output": {
"blitz" : [
"-Xmx7200m",
"-XX:MaxPermSize=1g"
"-XX:MaxPermSize=1g",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -154,7 +165,8 @@
"output": {
"blitz" : [
"-Xmx7200m",
"-XX:MaxPermSize=1g"
"-XX:MaxPermSize=1g",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -168,7 +180,8 @@
"output": {
"blitz" : [
"-Xmx9600m",
"-XX:MaxPermSize=1g"
"-XX:MaxPermSize=1g",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -182,6 +195,7 @@
"blitz" : [
"-Xmx512m",
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions",
"foo"
]
}
Expand All @@ -196,7 +210,8 @@
"output": {
"blitz" : [
"-Xmx4000m",
"-XX:MaxPermSize=512m"
"-XX:MaxPermSize=512m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -209,15 +224,18 @@
"output": {
"blitz" : [
"-Xmx1200m",
"-XX:MaxPermSize=512m"
"-XX:MaxPermSize=512m",
"-XX:+IgnoreUnrecognizedVMOptions"
],
"pixeldata" : [
"-Xmx1200m",
"-XX:MaxPermSize=512m"
"-XX:MaxPermSize=512m",
"-XX:+IgnoreUnrecognizedVMOptions"
],
"indexer" : [
"-Xmx800m",
"-XX:MaxPermSize=512m"
"-XX:MaxPermSize=512m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
},
Expand All @@ -230,7 +248,8 @@
"output": {
"blitz" : [
"-Xmx4g",
"-XX:MaxPermSize=256m"
"-XX:MaxPermSize=256m",
"-XX:+IgnoreUnrecognizedVMOptions"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions components/tools/OmeroPy/test/unit/test_jvmcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def test_hard_coded(self):
assert settings == [
"-Xmx512m",
"-XX:MaxPermSize=128m",
"-XX:+IgnoreUnrecognizedVMOptions",
]

def test_percent_usage(self):
Expand Down

0 comments on commit 83718b0

Please sign in to comment.