You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Last line of a .vmoptions file is silently ignored if it has no trailing newline #464
Describe the bug
The Linux launchers read .vmoptions files with a shell while read loop. read returns false on a final line that has no newline, so that line never reaches the JVM, and the launcher prints no warning. This reproduces every time.
This bites when someone appends -Xmx2g to conf/custom.vmoptions in an editor that does not add a final newline. The engine keeps running with the -Xmx256m from base_includes.vmoptions, which looks like base_includes overriding custom. The JVM uses the last -Xmx it receives, and -Xmx2g never gets there.
To Reproduce
Install 4.6.0 with oie_unix_4_6_0.sh.
printf '%s' '-Xmx2g' >> conf/custom.vmoptions (no trailing newline)
Actual behavior MaxHeapSize=268435456, and jcmd <pid> VM.command_line does not list -Xmx2g. After adding the newline (echo >> conf/custom.vmoptions) and restarting, MaxHeapSize is 2147483648.
Additional context
The generated install4j Unix launchers (oieservice, oieserver, oiecommand) use while read cur_option<&8; do, and server/basedir-includes/oieserver uses while IFS= read -r line; do. Both drop the line. The install4j code is not ours to change, so the proposed fix is a note in the conf/custom.vmoptions comments that the file must end with a newline.
I have not tested oieserver.ps1 or the Windows oieservice.exe. oieserver.ps1 reads with Get-Content, which returns an unterminated last line, so it is probably unaffected.
This is documented behavior for install4j. Therefore, I would not call it a bug.
In the .vmoptions file, each line is interpreted as a single VM parameter and the last line must be followed by a line feed.
The recommendation to put a reminder in the conf/custom.vmoptions comments is still a good one. Alternatively, we could put a comment at the end of the file instructing that all additions need to happen above that comment to avoid someone writing to the last line and missing the linefeed.
Activity
tonygermano commentedon Sep 28, 2026
This is documented behavior for install4j. Therefore, I would not call it a bug.
The recommendation to put a reminder in the
conf/custom.vmoptionscomments is still a good one. Alternatively, we could put a comment at the end of the file instructing that all additions need to happen above that comment to avoid someone writing to the last line and missing the linefeed.End custom.vmoptions with a comment so added options keep their newline