Delphi Clinic | C++Builder Gate | Training & Consultancy | Delphi Notes Weblog | Dr.Bob's Webshop |
|
Start applications a bit quicker
We all know Java applications aren't the fastest applications around.
It is still a lot slower than a native Windows application for example.
And therefore every bit of speed increase we can accomplish is welcome.
When we run a Java application we start up a Java Virtual Machine (JVM) and this JVM executes the Java application.
The JVM will reserve a space in memory of about 1Mb (the heap size) for loading the Java application.
If during the execution of the Java application, the application needs more memory, he JVM will expand this space in memory up to what is needed.
Especially this last process (expanding memory after initial startup size) takes time.
If we can allocate more memory (expand the heap size) when the JVM starts, we notice a slight performance increase because the extra memory doesn't need to be created during the application's execution time: it is already there!
We can include several arguments when starting the JVM and the one we want to use is:
-ms<number> Set the initial Java heap sizeIn JBuilder 2 we can go to File | Project properties... and select the Run/Debug tab. Here we can assign Java VM parameters. If we enter
-ms5120
, we create a initial heap size of 5Mb for our application.