scalability - dynamically increasing java heap space -


I have written a Java program that tests the speed of multi-threading algorithms with different processors of different machines.

On some machines, merge sort * fails because it requires a large size pile to work on large arrays. Before running the program, I can easily switch the Java heap space, but I think it would be a more robust and easier way to do this work from within the program.

Is there any way during a Java program

Note: I understand that I have a program with a program Scripts like "Java-XMX-1G program" can execute; My curiosity on this subject is in an academic section.

* My implementation does not merge in-line, it requires O (N) additional memory.

Java was not designed to be able to dynamically manage memory, this case In "Java Hip Space", on the other hand, it was designed to protect the programmer from worrying about it.

In short, I am afraid to say that there is nothing like "" malloc () " or " setHeapSize (int byes) " java .

On Java you are bound to lack the available memory for your program to start. It is a blessing and a curse in terms of memory management.

For that kind of dynamic memory allocation, you try to use your algorithm instead using the language C and / or C ++ should do.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -