
Do we really still need a 32-bit JVM? - theredviper
http://www.kubrynski.com/2015/05/do-we-really-still-need-32-bit-jvm.html
======
ci5er
Short answer: Yes

Longer answer: Why would you assume that your development preferences (yes,
preferences! not needs!) are so important as to justify cutting the legs out
from underneath a huge swath of problems that other people on the planet are
working on?

------
gardnr
As long as there are 32-bit processors or 32-bit hardware accelerated VMs
then: Yes.

~~~
justincormack
Well, 32 bit might get relegated to microcontrollers soon, and other
specialist stuff that doesnt run the JVM much. I cant see much mainstream 32
bit hardware being made in even 5 years.

~~~
cwyers
That seems like a pretty radical claim, considering that something like 99.9%
of extant Android phones are 32 bit.

~~~
rpcope1
This. Even _new_ ARM processors like A9 and A15 are still 32-bit, and this is
at the heart of many (most?) smartphones. Many low end x86 processors like a
lot of Atom chips are also 32-bit only. Just because most new consumer x86 is
now 64-bit doesn't mean at all that it's time to sunset a 32-bit JVM (if
you'll ever be able to do that).

~~~
vardump
Oh, it'll shift to 64-bit on ARM soon enough. Power efficiency. Flags register
consumes less power and less memory (cache) subsystem traffic.

It's funny that only things 64-bit ARM doesn't help with is supporting more
physical RAM (32-bit designs like Cortex A7 and A15 support 1 TB) or 64-bit
register width (almost totally useless). You probably want to rather use
128-bit wide NEON instructions...

~~~
cwyers
Gingerbread is roughly four and a half years old and it still runs on about 6
percent of Android devices in use. Adoption of new technology lags a lot more
at the tail - if Android was going to be completely off 32-bit in five years
time it would have to have significant adoption already.!

------
peapicker
Another consideration is that many shops have in place C and C++ code that is
32 bit, which hosts JVMs and uses JNI to talk to them.

~~~
lbearl
Yep, and that code isn't going anywhere anytime soon. Big, boring, slow moving
enterprise software. I work on one of these systems.

------
manishsharan
Garbage collection is much faster on 32 bit JVM than a corresponding 64 bit
JVM. Therefore I prefer to my small web applications or component that don't
need a ton of heapspace on 32 bit JVM.

~~~
MrBuddyCasino
Citation needed. Is this true even with compressed pointers?

~~~
breischl
Um, the article explicitly tested that case. Does that count as a citation?

~~~
MrBuddyCasino
Well now that you mention it. How I overlooked that is beyond me. Still hard
to believe the results, what is going on there?

------
rilita
Article more or less: "I don't think that we do, so I tested it a bit. Tests
confirm my assumptions. Still; there are cases where 32 bit is faster. I won't
bother to explain why."

As usual "All headlines that ask a question can be answered no" ( but inverted
to make it more confusing ). Really the title of the article to fit the mold
should be "Can we get rid of the 32-bit JVM?"

Really what should be done is take the algorithms from language competition
website, and then test all of those on 32-bit versus 64-bit with different
data sets. A few tests is hardly conclusive or explanative of what is fast and
what is slow.

Obviously a raw call to nanotime will be slow. Do you really need nanotime? If
you don't; is a lower precision call faster than nanotime?

------
Synaesthesia
So going to 32-bit JVM you sometimes get a slight performance boost, sometimes
a slight performance loss, and overall not a huge difference, so I don't think
it's really worth it, or even worth trying.

~~~
fian
The performance difference for 32-bit vs 64-bit JVMs can be significant for
some workloads. I develop a desktop engineering simulation application in
Java.

The simulation time for the same code running the same model on a 64-bit JRE
is often almost half the time required on a 32-bit JRE. With simulation times
measured in hours to days, this was an extremely nice "freebie" for painlessly
migrating to a 64-bit JRE.

We still support 32-bit JREs for each release as many corporate IT departments
are still migrating users from 32-bit Windows environments to 64-bit. However,
we strongly recommend the 64-bit version for the additional memory space that
can be allocated and the reduced simulation time.

------
protomyth
How is time handled on a 32-bit JVM?

~~~
organsnyder
Java has always stored time values as 64-bit longs representing milliseconds
since the Unix epoch. This includes System.currentTimeMillis(), as well as
what the java.util.Date class uses internally. I'm assuming that the Java 8
date-time API also does this (or something better—either way, I'm certain that
it's y2038-compliant).

So, even 32-bit Java is good for another 292 million years or so.

------
ww520
Yes. 32-bit machines are going away any time soon.

~~~
nayuki
Did you mean to write "aren't"?

------
nikanj
Maybe you don't, but we most definitely do.

