Does Java source files in the JAR increase JVM memory?

If not, why not always include the source file in open source JAR distributions? (thanks in advance if you have official web links that explain your answers)

+4
source share
4 answers

No, this does not increase memory consumption. And this was not done because it would increase the size of the JAR without any benefits for most users. And no, the size of the JAR does not matter. It may not matter to you whether the download is 5 or 7 MB, but it is of great importance to the one who has to pay for the 100,000 people downloading it.

+5
source

Typically, separate JAR or ZIP files containing JavaDocs or source files are available. In addition, most IDEs allow you to specify source files and folders for the JAR in your class path.

If you use Maven, you can automatically download the source files and doc files, as well as configure them as source files in your IDE (for Eclipse, at least).

+3
source

No, as far as I know, source JARs do not consume additional RAM.

There are bandwidth considerations for always downloading Javadoc and a source for third-party libraries, so perhaps, in the name of saving a few dollars, they do not include the source in their distributions and suggest that users can download it themselves if they wish. In the case of maven, for example, it really doesn't make sense to load the source for your dependencies at three levels, so only the class files are cached in order.

+3
source

I don’t see how including source files in "jar" or "tar" or "tgz" (separately or together with binary files) will make any difference to you if you can access open sources

+1
source

Source: https://habr.com/ru/post/1311402/


All Articles