On Tue, 9 Jun 2026 06:10:35 GMT, David Holmes <[email protected]> wrote:

>> Please review this change to allow XX configuration for specifying a 
>> different /tmp directory for the JVM to use.  In some container 
>> environments, /tmp and /proc/pid/root/tmp might not be usable and an 
>> alternate would be used.  This requires a release note and CSR.   Usage is:
>> 
>> java -XX:AltTempDir=/diags <app>
>> jps -J-XX:AltTempDir=/diags
>> jcmd -J-XX:AltTempDir=/diags <pid> <cmds>
>> 
>> Tested with a couple of tests and locally, and ran tier1-4.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> src/hotspot/os/linux/os_linux.cpp line 1560:
> 
>> 1558: void os::pd_check_temp_directory() {
>> 1559:   if (AltTempDir != nullptr && AltTempDir[0] != '\0') {
>> 1560:     size_t safe_max = PATH_MAX - 100; // accounting for /proc/%pid 
>> composition in containers
> 
> PATH_MAX or UNIX_PATH_MAX?

Ignore this. PATH_MAX is correct

> src/hotspot/os/posix/attachListener_posix.cpp line 349:
> 
>> 347:   int ret;
>> 348: 
>> 349:   int n = os::snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
> 
> UNIX_PATH_MAX or PATH_MAX?

Not sure why this is using UNIX_PATH_MAX but pre-existing so ignore this too.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3384967946
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3384970562

Reply via email to