±Û¾´ÀÌ :°½Åµ¿ 1998³â 11¿ù 30ÀÏ 09:45:48
In Reply to: ¸Þ¸ð¸®... posted by Â÷À±ÁØ on 1998³â 11¿ù 30ÀÏ 00:48:26:
¾È³çÇϼ¼¿ä °½Åµ¿ÀÔ´Ï´Ù.
¸Þ¸ð¸® size¸¦ ¾Ë ¼ö ÀÖ½À´Ï´Ù.
public class M
{
public static void main(String[] arg)
{
Runtime r = Runtime.getRuntime();
long total = r.totalMemory();
System.out.println("total memory is "+total);
long free = r.freeMemory();
System.out.println("free memory is "+free);
}
}
java.exeÀÇ optionÀ» º¸¸é ¾Æ·¡ÀÇ µÎ°¡Áö°¡ memory¿¡ °ü·ÃµÈ °ÍÀÔ´Ï´Ù.
-ms set the initial Java heap size
-mx set the maximum Java heap size
C:\blackbox\java.lang>java M
total memory is 1048568
free memory is 801176
C:\blackbox\java.lang>java -ms6 M
total memory is 1048568
free memory is 801176
C:\blackbox\java.lang>java -mx6 M
total memory is 1048568
free memory is 801176
³»ºÎÀûÀ¸·Î memory heap size¸¦ ¾î¶»°Ô »ç¿ëÇÏ´ÂÁö´Â ¸ð¸£Áö¸¸ ¾î·µç
total memory¿Í free memory¸¦ ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Korea Java Developer Connection °ü¸®ÀÚ °½Åµ¿µå¸²