mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
12 hours ago 005b222484780397493d246be89c831734393fca
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Saturday, November 21, 2026 09:53 +0100
committer GitHub <noreply@github.com>
Saturday, November 21, 2026 09:53 +0100
commit005b222484780397493d246be89c831734393fca
tree 86505697d60e8143de5ccdb5e00aea19464824fa tree | zip | gz
parent ddd9072a2e164548fbfc33eefeeb43045adb0b3d view | diff
[#1310] Limit OpenDJ helper JVM heaps (#1312)

## Motivation

Helper JVMs run alongside the directory server during lifecycle
operations and Docker health checks. They can contribute to memory
pressure in small containers. The released Alpine image has timed out
during bootstrap in the 512 MiB upgrade test. [Example CI
run](https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/44271307242/job/134808614378)

## Changes

- Cap `WaitForFileDelete` at 16 MiB in the Unix and Windows start and
stop launchers. Clear `JAVA_TOOL_OPTIONS`, `JDK_JAVA_OPTIONS`, and
`_JAVA_OPTIONS` for the waiter invocation. Server launches and
subsequent lifecycle checks still receive their configured JVM options.
- Check the bootstrap marker and the local LDAPS TCP port before
launching the Docker health check's LDAP client. The root-DSE search
inherits the configured JVM options, including Java security and TLS
settings.
- Preserve the packaged `ldapsearch` launcher argument precedence. With
no command-specific property, the Unix launcher uses `default.java-args`
when JVM arguments are configured through `java.properties`.

#1319 handles removing the Unix detached-start waiter and reporting
early server exit.

## Validation

- Exercised Unix start, stop, and restart in normal and quiet modes with
the real waiter on JDK 21. Each waiter had a 16 MiB maximum, and the
server fixture received its original JVM environment.
- Exercised all five Windows waiter invocations with JDK 11 under Wine.
Each used a 16 MiB maximum and restored the surrounding JVM environment.
- Ran the updated health check against the default and Alpine OpenDJ
5.2.0 images. A missing bootstrap marker or a closed port returned `1`
before LDAP. The root-DSE search succeeded with configured TLS 1.2 and
inherited heap settings, including a 128 MiB soft maximum. A valid
optional bind passed and an invalid bind returned `1`.
- Verified with packaged `ldapsearch --help` on JDK 21 that a custom
`default.java-args` produced the configured 256 MiB initial heap and 512
MiB maximum.
- Bootstrap stability at 512 MiB remains unverified for this revision.

Fixes #1310
7 files modified
58 ■■■■■ changed files
opendj-packages/opendj-docker/healthcheck.sh 6 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/resource/bin/_script-util.sh 6 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/resource/bin/start-ds 4 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/resource/bin/start-ds.bat 28 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/resource/bin/stop-ds 5 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/resource/bin/stop-ds.bat 7 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/resource/config/java.properties 2 ●●●●● diff | view | raw | blame | history