In defense of the Windows x86-32 Port
Thomas Stüfe
thomas.stuefe at gmail.com
Tue Feb 28 10:14:29 UTC 2023
On Tue, Feb 28, 2023 at 11:06 AM Thomas Stüfe <thomas.stuefe at gmail.com>
wrote:
>
>
> On Sun, Feb 26, 2023 at 6:09 AM <mark.yagnatinsky at barclays.com> wrote:
>
>> I saw this JEP draft today: https://openjdk.org/jeps/8303167. It
>> suggests deprecating the 32-bit Windows port of OpenJDK.
>>
>> And even though it’s “just a draft” it does mention Java 21 (which is
>> pretty soon), so I thought I might as well put in my “two cents” now
>> instead of waiting to see whether or not this ends up going anywhere.
>>
>> The draft is written as though the (primary?) purpose of the port is to
>> support running Java on 32-bit versions of Windows.
>>
>> Those are indeed very rare, and getting even rarer. But I appreciate the
>> 32-bit builds even though I haven’t run a 32-bit version of Windows in ages.
>>
>> Unlike MacOS, it is possible (and effortless) to run 32-bit executables
>> on 64-bit Windows. There are at least 2 reasons to do so:
>>
>> The obvious reason is that maybe someone has some native code they’re
>> calling via JNI, and they don’t have a 64-bit version handy.
>>
>> The other reason is perhaps less obvious, and perhaps I’m the only person
>> in the world who considers this a “reason” at all, but it motivated me to
>> write this email so here it is:
>>
>> The restriction to 32-bits is pretty effective as a poor man’s substitute
>> for a proper sandbox.
>>
>> For example, the draft JEP talks about Project loom, a topic near and
>> dear to me. When I first heard of Project loom, I wanted to run two silly
>> experiments.
>>
>> The first experiment was to launch as many “platform” threads as I could,
>> and thus get a feel for how much they “cost”. The second experiment was to
>> do the same for “virtual” threads.
>>
>> I actually carried out the first experiment, on a 32-bit JVM. I did not
>> dare to try the same experiment on a 64-bit JVM.
>>
>> The reason is that I knew that with a 32-bit JVM, I would run out of
>> address space before anything bad happened.
>>
>> But if I tried the same thing with a 64-bit JVM, then for all I know I
>> might bring my poor laptop to its knees and might even be forced to restart.
>>
>> I’ve been eagerly awaiting Alexey Shipilev’s 32-bit port (is anyone else
>> besides him working on this?) ever since then so I could try the “loom”
>> part of the experiment.
>>
>> I’ll be a bit disappointed if it never appears.
>>
>>
>>
>> Anyway, that’s my two cents; thanks if you read this far.
>>
>
> I agree that the JEP description is misleading; as you wrote, Windows 11
> is able to run 32-bit processes.
>
> Note that another advantage of 32-bit ports is that they can save quite a
> bit of memory if footprint is dominated by native memory and not java heap.
> That may not matter so much for Windows though.
>
> Cheers, Thomas
>
>
>
One small plus of getting rid of the 32-bit windows port would be that we
could remove the specifiers for calling conventions (__cdecl and friends)
and JNICALL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20230228/8d09d00b/attachment.htm>
More information about the jdk-dev
mailing list