Skip to content

Commit 1296f4b

Browse files
committed
Fix JRUBY-6016: JRuby 1.6.3 does not respect JAVA_MEM
1 parent ccd1ebb commit 1296f4b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

argparser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ bool ArgParser::parseArgs(int argc, char *argv[]) {
230230
noBootClassPath = true;
231231
}
232232

233+
const char *java_mem = getenv("JAVA_MEM");
234+
if (java_mem != NULL) {
235+
javaOptions.push_back(java_mem);
236+
}
237+
233238
addToArgList(args, argc, argv);
234239

235240
logMsg("Parsing arguments:");

spec/launcher_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@
196196
end
197197
end
198198

199+
# JRUBY-6016
200+
it "should honor JAVA_MEM" do
201+
with_environment "JAVA_MEM" => "-Xmx768m" do
202+
jruby_launcher_args("").should include("-Xmx768m", "-Djruby.memory.max=768m")
203+
end
204+
end
205+
199206
it "should print the version" do
200207
jruby_launcher("-Xversion 2>&1").should =~ /Launcher Version [0-9.]+/
201208
end

0 commit comments

Comments
 (0)