I think he's referring to a perfectly easy DOS attack:
1 2 3 4
| ArrayList a = new ArrayList(100000); for (;;) { a.add(ByteBuffer.allocateDirect(1000000000)); } |
That'll just chew into swapspace into milliseconds and grind the system to a halt, before finally running out of memory. You could even catch the OutOfMemoryError and then sit in an infinite busy loop writing bytes into the memory as well just to make sure it kept swapping like crazy.
Of course that's no more sophisticated than:
1 2 3
| for (;;) { new Thread() { public void run() { for (;;); } }.start(); } |
which will rapidly consume all the available OS resources if it doesn't run out of thread stack memory.
There is possibly a requirement highlighted here that the JVM has a security mechanism in place to prevent such DOS attacks by limiting the availability of some resources by default.
Cas
