Is there any way to limit maximum virtual memory usage of javac?
When running java, I can run it with "-XmxAm" (where A is number of free megabytes) to limit it.
Is there anything for javac like that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can give the same runtime options to javac (and most java programs with an own native starter) by using
-Joptions. By convention, all such options are passed directly to the runtime system. So, in your case, you can invoketo run javac with very little memory. Of course, as reseter said, it is of limited use this way, since javac may really need some amount of memory to compile. On really big projects, you may want to increase the memory this way, though.