Bureaucrats, cc_docs_admin, cc_staff
2,306
edits
No edit summary |
No edit summary |
||
Line 28: | Line 28: | ||
===Memory Issues=== | ===Memory Issues=== | ||
Java uses an automatic system called ''garbage collection'' to identify variables which are out of scope and return the memory associated with them to the operating system which however doesn't stop many Java programs from requiring significant amounts of memory to run correctly. When a Java virtual machine is launched using the <tt>java</tt> command a default amount of the system memory is allocated to this virtual machine which may be inadequate. | Java uses an automatic system called ''garbage collection'' to identify variables which are out of scope and return the memory associated with them to the operating system which however doesn't stop many Java programs from requiring significant amounts of memory to run correctly. When a Java virtual machine is launched using the <tt>java</tt> command a default amount of the system memory is allocated to this virtual machine which may be inadequate. To correct this problem, you can tell the Java virtual machine the maximum amount of memory to use with the command line argument <tt>Xmx</tt>, for instance | ||
{{Command|java -Xmx4096m file.jar}} | |||
tells the Java virtual machine that it can use up to 4096 MB of memory. | |||
===The <tt>volatile</tt> Keyword=== | ===The <tt>volatile</tt> Keyword=== |