Note, however, that your system may impose limits on the maximum amount of memory a single process is allowed to use. If this value is smaller than the total amount of RAM on the system, then you won't be able to use it all with a single program,
Java or otherwise. You can of course still easily use up all the memory the JVM is allowed.