On Tue, 7 Jul 2026 17:59:52 GMT, Coleen Phillimore <[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).
>
> Coleen Phillimore has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - Fix PlatformSupportImpl due to some internal code review comments.
>  - Add similar jps wording.

Sorry for being late to the party. I've posted a couple of nits and questions. 
I'm still reviewing this PR.

src/hotspot/os/linux/os_linux.cpp line 1558:

> 1556: 
> 1557: // Check that any given alternate temporary directory name is is a 
> writable directory,
> 1558: // and specifies an absolute path.  Revert back to hardcoded /tmp if 
> its not an absolute path, but

Nit: Typos:
 - L1557: s/is is/is/
 - L1558: s/if its not/if it is not/

src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c line 267:

> 265:  * Class:     sun_tools_attach_VirtualMachineImpl
> 266:  * Method:    validateSocketFileLength
> 267:  * Signature: (I)B

Nit: The Java declaration is static native `boolean 
validateSocketFileLength(String socketPath);`.
Then should it be: `(Ljava/lang/String;)Z`?

src/jdk.internal.jvmstat/linux/classes/sun/jvmstat/PlatformSupportImpl.java 
line 207:

> 205:                 seenProc = true;
> 206:                 continue;
> 207:             }

Q1: How would the above work if the TMP directory was set/customized with the 
option:
 `-XX:AltTempDir=/work/proc/tmp` ? What happens if there are multiple `proc` 
path folders?

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

PR Review: https://git.openjdk.org/jdk/pull/31407#pullrequestreview-4652008246
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3542375653
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3542173944
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3542300457

Reply via email to