EVALUATION
There are a couple of problems here.
- The test in question doesn't scale to 64-bit machines. It assumes that
an attempt to specify a value of 42g to the -XX:MaxDirectMemorySize flag
will be ignored. This is true on 32-bit machines, since 42g parses to a
negative number, which is then ignored by sun.misc.VM.maxDirectMemory(),
but it's not true on 64-bit machines.
- The VM.maxDirectMemory method doesn't behave properly on negative numbers.
Rather than taking the hardwired default of 64MB it should instead take the
value of Runtime.getRuntime().maxMemory(). This difference is more
noticeable now that we have ergonomic GC sizing.
I've submitted a separate bug for the second problem (5047688).
The equivalent test in the J2SE regression suite also fails on 64-bit machines.
We will fix that test (4862640), but it'll up to CTE to apply the corresponding
fix to their copy of it. (It would probably make more sense for that test
simply to be deleted from the CTE suite since it's redundant.)
-- ###@###.### 2004/5/14