Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÄÚ´æ»ØÊÕ»úÖÆ

ÒýÑÔ
JavaµÄ¶ÑÊÇÒ»¸öÔËÐÐʱÊý¾ÝÇø,ÀàµÄʵÀý(¶ÔÏó)´ÓÖзÖÅä¿Õ¼ä¡£JavaÐéÄâ»ú(JVM)µÄ¶ÑÖд¢´æ×ÅÕýÔÚÔËÐеÄÓ¦ÓóÌÐòËù½¨Á¢µÄËùÓжÔÏó£¬ÕâЩ¶ÔÏóͨ¹ýnew¡¢newarray¡¢anewarrayºÍmultianewarrayµÈÖ¸ÁÁ¢£¬µ«ÊÇËüÃDz»ÐèÒª³ÌÐò´úÂëÀ´ÏÔʽµØÊÍ·Å¡£Ò»°ãÀ´Ëµ£¬¶ÑµÄÊÇÓÉÀ¬»ø»ØÊÕ À´¸ºÔðµÄ£¬¾¡¹ÜJVM¹æ·¶²¢²»ÒªÇóÌØÊâµÄÀ¬»ø»ØÊÕ¼¼Êõ£¬ÉõÖÁ¸ù±¾¾Í²»ÐèÒªÀ¬»ø»ØÊÕ£¬µ«ÊÇÓÉÓÚÄÚ´æµÄÓÐÏÞÐÔ£¬JVMÔÚʵÏÖµÄʱºò¶¼ÓÐÒ»¸öÓÉÀ¬»ø»ØÊÕËù¹ÜÀíµÄ¶Ñ¡£À¬»ø»ØÊÕÊÇÒ»ÖÖ¶¯Ì¬´æ´¢¹ÜÀí¼¼Êõ£¬Ëü×Ô¶¯µØÊͷŲ»ÔÙ±»³ÌÐòÒýÓõĶÔÏ󣬰´ÕÕÌض¨µÄÀ¬»øÊÕ¼¯Ëã·¨À´ÊµÏÖ×ÊÔ´×Ô¶¯»ØÊյŦÄÜ¡£
À¬»øÊÕ¼¯µÄÒâÒå
ÔÚC++ÖУ¬¶ÔÏóËùÕ¼µÄÄÚ´æÔÚ³ÌÐò½áÊøÔËÐÐ֮ǰһֱ±»Õ¼Óã¬ÔÚÃ÷È·ÊÍ·Å֮ǰ²»ÄÜ·ÖÅä¸øÆäËü¶ÔÏ󣻶øÔÚJavaÖУ¬µ±Ã»ÓжÔÏóÒýÓÃÖ¸ÏòÔ­ÏÈ·ÖÅä¸øij¸ö¶ÔÏóµÄÄÚ´æʱ£¬¸ÃÄÚ´æ±ã³ÉΪÀ¬»ø¡£JVMµÄÒ»¸öϵͳ¼¶Ï̻߳á×Ô¶¯ÊͷŸÃÄÚ´æ¿é¡£À¬»øÊÕ¼¯Òâζ×ųÌÐò²»ÔÙÐèÒªµÄ¶ÔÏóÊÇ"ÎÞÓÃÐÅÏ¢"£¬ÕâЩÐÅÏ¢½«±»¶ªÆú¡£µ±Ò»¸ö¶ÔÏó²»ÔÙ±»ÒýÓõÄʱºò£¬ÄÚ´æ»ØÊÕËüÕ¼ÁìµÄ¿Õ¼ä£¬ÒÔ±ã¿Õ¼ä±»ºóÀ´µÄжÔÏóʹÓá£ÊÂʵÉÏ£¬³ýÁËÊÍ·ÅûÓõĶÔÏó£¬À¬»øÊÕ¼¯Ò²¿ÉÒÔÇå³ýÄÚ´æ¼Ç¼ËéƬ¡£ÓÉÓÚ´´½¨¶ÔÏóºÍÀ¬»øÊÕ¼¯Æ÷ÊͷŶªÆú¶ÔÏóËùÕ¼µÄÄÚ´æ¿Õ¼ä£¬ÄÚ´æ»á³öÏÖËéƬ¡£ËéƬÊÇ·ÖÅä¸ø¶ÔÏóµÄÄÚ´æ¿éÖ®¼äµÄ¿ÕÏÐÄڴ涴¡£ËéƬÕûÀí½«ËùÕ¼ÓõĶÑÄÚ´æÒƵ½¶ÑµÄÒ»¶Ë£¬JVM½«ÕûÀí³öµÄÄÚ´æ·ÖÅä¸øеĶÔÏó¡£
À¬»øÊÕ¼¯ÄÜ×Ô¶¯ÊÍ·ÅÄÚ´æ¿Õ¼ä£¬¼õÇá±à³ÌµÄ¸ºµ£¡£ÕâʹJava ÐéÄâ»ú¾ßÓÐһЩÓŵ㡣Ê×ÏÈ£¬ËüÄÜʹ±à³ÌЧÂÊÌá¸ß¡£ÔÚûÓÐÀ¬»øÊÕ¼¯»úÖƵÄʱºò£¬¿ÉÄÜÒª»¨Ðí¶àʱ¼äÀ´½â¾öÒ»¸öÄѶ®µÄ´æ´¢Æ÷ÎÊÌâ¡£ÔÚÓÃJavaÓïÑÔ±à³ÌµÄʱºò£¬¿¿À¬»øÊÕ¼¯»úÖÆ¿É´ó´óËõ¶Ìʱ¼ä¡£Æä´ÎÊÇËü±£»¤³ÌÐòµÄÍêÕûÐÔ, À¬»øÊÕ¼¯ÊÇJavaÓïÑÔ°²È«ÐÔ²ßÂÔµÄÒ»¸öÖØÒª²¿·Ý¡£
À¬»øÊÕ¼¯µÄÒ»¸öDZÔÚµÄȱµãÊÇËüµÄ¿ªÏúÓ°Ïì³ÌÐòÐÔÄÜ¡£JavaÐéÄâ»ú±ØÐë×·×ÙÔËÐгÌÐòÖÐÓÐÓõĶÔÏó, ¶øÇÒ×îÖÕÊÍ·ÅûÓõĶÔÏó¡£ÕâÒ»¸ö¹ý³ÌÐèÒª»¨·Ñ´¦ÀíÆ÷µÄʱ¼ä¡£Æä´ÎÀ¬»øÊÕ¼¯Ëã·¨µÄ²»Í걸ÐÔ£¬ÔçÏȲÉÓõÄijЩÀ¬»øÊÕ¼¯Ëã·¨¾Í²»Äܱ£Ö¤100%ÊÕ¼¯µ½ËùÓеķÏÆúÄÚ´æ¡£µ±È»Ëæ×ÅÀ¬»øÊÕ¼¯Ëã·¨µÄ²»¶Ï¸Ä½øÒÔ¼°ÈíÓ²¼þÔËÐÐЧÂʵIJ»¶ÏÌáÉý£¬ÕâЩÎÊÌⶼ¿ÉÒÔÓ­Èжø½â¡£
À¬»øÊÕ¼¯µÄËã·¨·ÖÎö
JavaÓïÑԹ淶ûÓÐÃ÷È·µØ˵Ã÷JVMʹÓÃÄÄÖÖÀ¬»ø»ØÊÕËã·¨£¬µ«ÊÇÈκÎÒ»ÖÖÀ¬»øÊÕ¼¯Ëã·¨Ò»°ãÒª×ö2¼þ»ù±¾µÄÊÂÇ飺£¨1£©·¢ÏÖÎÞÓÃÐÅÏ¢¶ÔÏ󣻣¨2£©»ØÊÕ±»ÎÞÓöÔÏóÕ¼ÓõÄÄÚ´æ¿Õ¼ä£¬Ê¹¸Ã¿Õ¼ä¿É±»³ÌÐòÔÙ´ÎʹÓá£
´ó¶àÊýÀ¬»ø»ØÊÕË㷨ʹÓÃÁ˸ù¼¯(root set)Õâ¸ö¸ÅÄËùν¸ù¼¯¾ÍÁ¿Õ


Ïà¹ØÎĵµ£º

JavaÉè¼Æģʽ֮:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËر¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

java tips

1£¬intÓëbytes ת»»
intת»»³Ébytes
public
static
final
byte
[]
int2bytes
(
int
value
)

{
return
new
byte
[]

{
(
byte
)(
value
>>>
24
),
(
byte
)(
value
>>>
16
),
......

Java SWT ´°¿Ú¾ÓÖжÔÆë

public static void CentreWnd(Shell shell){
int width = shell.getMonitor().getClientArea().width;
int height = shell.getMonitor().getClientArea().height;
int x = shell.getSize().x;
int y = shell.getSize().y;
if (x > width) {
shell.getSize().x = width;
}
if (y > height) ......

Java¶ÔÏó¿½±´

public class Person implements Serializable {
    private String name;
    private int age;
    private GregorianCalendar birthday;
    public Person(){
       
    }
    p ......

Java·¾¶ÎÊÌâ×îÖÕ½â¾ö·½°¸

Ç°ÑÔ
¡¡¡¡JavaµÄ·¾¶ÎÊÌ⣬·Ç³£ÄѸ㡣×î½üµÄ¹¤×÷Éæ¼°µ½´´½¨ºÍ¶ÁÈ¡ÎļþµÄ¹¤×÷£¬ÕâÀïÎҾ͸ø´ó¼Ò³¹µ×µÃ½â¾öJava·¾¶ÎÊÌâ¡£
¡¡
¡¡ÎÒ±àдÁËÒ»¸ö·½·¨£¬±ÈClassLoader.getResource(String
Ïà¶Ô·¾¶)·½·¨µÄÄÜÁ¦¸üÇ¿¡£Ëü¿ÉÒÔ½ÓÊÜ"../"ÕâÑùµÄ²ÎÊý£¬´ðÓ¦ÎÒÃÇÓÃÏà¶Ô·¾¶À´¶¨Î»classpathÍâÃæµÄ×ÊÔ´¡£ÕâÑù£¬ÎÒÃǾͿÉÒÔʹÓÃÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ