Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the size of a jar file affect the performance of the JVM?

I was wondering if the size of jar file has any implications for the peformance of the Java Virtual Machine?

Is there going to be a point where the jar file becomes too large that the JVM will not be able to function effectively?

like image 931
Pram Avatar asked Aug 26 '10 12:08

Pram


1 Answers

Yes, the size of the jar file has implications on performance. The more appropriate question is, does it have any significant implications? The answer to that question is no.

Yes, there is a point where the jar file becomes too large and affects the JVM. I don't know where it is, but it's somewhere near the size of your system memory. If the JVM cannot load the entire JAR file and the Java libraries in system memory without swapping, this will certainly affect performance.

This isn't something you need to concern yourself with. Don't include JAR files in the classpath that aren't being used. Don't include a bunch of code in your project JAR file that isn't being used. I highly doubt you'd be creating an application anywhere near the size required to impact the performance of the JVM.

like image 83
Erick Robertson Avatar answered Oct 12 '22 20:10

Erick Robertson