¡¾×ª¡¿ÓÅÐãJava³ÌÐòÔ±±ØÐëÁ˽âµÄGC¹¤×÷ÔÀí
Ò»¸öÓÅÐãµÄJava³ÌÐòÔ±±ØÐëÁ˽âGCµÄ¹¤×÷ÔÀí¡¢ÈçºÎÓÅ»¯GCµÄÐÔÄÜ¡¢ÈçºÎÓëGC½øÐÐÓÐÏ޵Ľ»»¥£¬ÒòΪÓÐһЩӦÓóÌÐò¶ÔÐÔÄÜÒªÇó½Ï¸ß£¬ÀýÈçǶÈëʽϵͳ¡¢ÊµÊ±ÏµÍ³µÈ£¬Ö»ÓÐÈ«ÃæÌáÉýÄÚ´æµÄ¹ÜÀíЧÂÊ £¬²ÅÄÜÌá¸ßÕû¸öÓ¦ÓóÌÐòµÄÐÔÄÜ¡£±¾ÆªÎÄÕÂÊ×Ïȼòµ¥½éÉÜGCµÄ¹¤×÷ÔÀíÖ®ºó£¬È»ºóÔÙ¶ÔGCµÄ¼¸¸ö¹Ø¼üÎÊÌâ½øÐÐÉîÈë̽ÌÖ£¬×îºóÌá³öһЩJava³ÌÐòÉè¼Æ½¨Ò飬´ÓGC½Ç¶ÈÌá¸ßJava³ÌÐòµÄÐÔÄÜ¡£
GCµÄ»ù±¾ÔÀí
JavaµÄÄÚ´æ¹ÜÀíʵ¼ÊÉϾÍÊǶÔÏóµÄ¹ÜÀí£¬ÆäÖаüÀ¨¶ÔÏóµÄ·ÖÅäºÍÊÍ·Å¡£
¶ÔÓÚ³ÌÐòÔ±À´Ëµ£¬·ÖÅä¶ÔÏóʹÓÃnew¹Ø¼ü×Ö£»ÊͷŶÔÏóʱ£¬Ö»Òª½«¶ÔÏóËùÓÐÒýÓø³ÖµÎªnull£¬ÈóÌÐò²»Äܹ»ÔÙ·ÃÎʵ½Õâ¸ö¶ÔÏó£¬ÎÒÃdzƸöÔÏóΪ"²»¿É´ïµÄ".GC½«¸ºÔð»ØÊÕËùÓÐ"²»¿É´ï"¶ÔÏóµÄÄÚ´æ¿Õ¼ä¡£
¶ÔÓÚGCÀ´Ëµ£¬µ±³ÌÐòÔ±´´½¨¶ÔÏóʱ£¬GC¾Í¿ªÊ¼¼à¿ØÕâ¸ö¶ÔÏóµÄµØÖ·¡¢´óСÒÔ¼°Ê¹ÓÃÇé¿ö¡£Í¨³££¬GC²ÉÓÃÓÐÏòͼµÄ·½Ê½¼Ç¼ºÍ¹ÜÀí¶Ñ£¨heap£©ÖеÄËùÓжÔÏó£¨Ïê¼û ²Î¿¼×ÊÁÏ1 £©¡£Í¨¹ýÕâÖÖ·½Ê½È·¶¨ÄÄЩ¶ÔÏóÊÇ"¿É´ïµÄ"£¬ÄÄЩ¶ÔÏóÊÇ"²»¿É´ïµÄ".µ±GCÈ·¶¨Ò»Ð©¶ÔÏóΪ"²»¿É´ï"ʱ£¬GC¾ÍÓÐÔðÈλØÊÕÕâЩÄÚ´æ¿Õ¼ä¡£µ«ÊÇ£¬ÎªÁ˱£Ö¤ GCÄܹ»ÔÚ²»Í¬Æ½Ì¨ÊµÏÖµÄÎÊÌ⣬Java¹æ·¶¶ÔGCµÄºÜ¶àÐÐΪ¶¼Ã»ÓнøÐÐÑϸñµÄ¹æ¶¨¡£ÀýÈ磬¶ÔÓÚ²ÉÓÃʲôÀàÐ͵ĻØÊÕËã·¨¡¢Ê²Ã´Ê±ºò½øÐлØÊÕµÈÖØÒªÎÊÌⶼûÓÐÃ÷È·µÄ¹æ¶¨¡£Òò´Ë£¬²»Í¬µÄJVMµÄʵÏÖÕßÍùÍùÓв»Í¬µÄʵÏÖËã·¨¡£ÕâÒ²¸øJava³ÌÐòÔ±µÄ¿ª·¢´øÀ´Ðж಻ȷ¶¨ÐÔ¡£±¾ÎÄÑо¿Á˼¸¸öÓëGC¹¤×÷Ïà¹ØµÄÎÊÌ⣬ŬÁ¦¼õÉÙÕâÖÖ²»È·¶¨ÐÔ¸øJava³ÌÐò´øÀ´µÄ¸ºÃæÓ°Ïì¡£
ÔöÁ¿Ê½GC£¨ Incremental GC £©
GCÔÚJVMÖÐͨ³£ÊÇÓÉÒ»¸ö»òÒ»×é½ø³ÌÀ´ÊµÏֵģ¬Ëü±¾ÉíÒ²ºÍÓû§³ÌÐòÒ»ÑùÕ¼ÓÃheap¿Õ¼ä£¬ÔËÐÐʱҲռÓÃCPU.µ±GC½ø³ÌÔËÐÐʱ£¬Ó¦ÓóÌÐòÍ£Ö¹ÔËÐС£Òò´Ë£¬µ±GCÔËÐÐʱ¼ä½Ï³¤Ê±£¬Óû§Äܹ»¸Ðµ½ Java³ÌÐòµÄÍ£¶Ù£¬ÁíÍâÒ»·½Ã棬Èç¹ûGCÔËÐÐʱ¼äÌ«¶Ì£¬Ôò¿ÉÄܶÔÏó»ØÊÕÂÊÌ«µÍ£¬ÕâÒâζ×Å»¹ÓкܶàÓ¦¸Ã»ØÊյĶÔÏóûÓб»»ØÊÕ£¬ÈÔȻռÓôóÁ¿ÄÚ´æ¡£Òò´Ë£¬ÔÚÉè¼ÆGCµÄʱºò£¬¾Í±ØÐëÔÚÍ£¶Ùʱ¼äºÍ»ØÊÕÂÊÖ®¼ä½øÐÐȨºâ¡£Ò»¸öºÃµÄGCʵÏÖÔÊÐíÓû§¶¨Òå×Ô¼ºËùÐèÒªµÄÉèÖã¬ÀýÈçÓÐЩÄÚ´æÓÐÏÞÓÐÉ豸£¬¶ÔÄÚ´æµÄʹÓÃÁ¿·Ç³£Ãô¸Ð£¬Ï£ÍûGCÄܹ»×¼È·µÄ»ØÊÕÄڴ棬Ëü²¢²»ÔÚÒâ³ÌÐòËٶȵķÅÂý¡£ÁíÍâһЩʵʱÍøÂçÓÎÏ·£¬¾Í²»Äܹ»ÔÊÐí³ÌÐòÓг¤Ê±¼äµÄÖжϡ£ÔöÁ¿Ê½GC¾ÍÊÇͨ¹ýÒ»¶¨µÄ»ØÊÕËã·¨£¬°ÑÒ»¸ö³¤Ê±¼äµÄÖжϣ¬»®·ÖΪºÜ¶à¸öСµÄÖжϣ¬Í¨¹ýÕâÖÖ·½Ê½¼õÉÙGC¶ÔÓû§³ÌÐòµÄÓ°Ïì¡£ËäÈ»£¬ÔöÁ¿Ê½GCÔÚÕûÌåÐÔÄÜÉÏ¿ÉÄܲ»ÈçÆÕͨGCµÄЧÂʸߣ¬µ«ÊÇËüÄܹ»¼õÉÙ³ÌÐòµÄ×ͣ¶Ùʱ¼ä¡£
Sun JDKÌṩµÄHotSpot J
Ïà¹ØÎĵµ£º
ÓÅÏȼ¶
ÔËËã·û
Ãû³Æ
1
( )
À¨ºÅ
2
[ ] , ¡£
ºó׺ÔËËã·û
3
- (Ò»ÔªÔËËã·û£¬È¡¸ºÊý) , ! , ~ , ++ , --
Ò»ÔªÔËËã·û
4
* , / , %
³Ë£¬³ý£¬È¡Ä£
5
+, -
¼Ó£¬¼õ
6
>> , << , >>>
ÒÆλÔËËã·û
7
> , < , >= , <= , instanceof
¹ØϵÔËËã·û
8
==,!=
µÈÓÚ£¬²»µÈÓÚ
9
......
ÎÒÃDz»·ÁÉèÏ룬ΪÁË´´½¨Ò»¸öеÄỊ̈߳¬ÎÒÃÇÐèÒª×öЩʲô£¿ºÜÏÔÈ»£¬ÎÒÃDZØÐëÖ¸Ã÷Õâ¸öÏß³ÌËùÒªÖ´ÐеĴúÂ룬¶øÕâ¾ÍÊÇÔÚJavaÖÐʵÏÖ¶àÏß³ÌÎÒÃÇËùÐèÒª×öµÄÒ»ÇУ¡
×÷Ϊһ¸öÍêÈ«ÃæÏò¶ÔÏóµÄÓïÑÔ£¬JavaÌṩÁËÀà java.lang.Thread À´·½±ã¶àÏ̱߳à³Ì£¬Õâ¸öÀàÌṩÁË´óÁ¿µÄ·½·¨À´·½±ãÎÒÃÇ¿ØÖÆ×Ô¼ºµÄ¸÷¸öÏ̡߳£
  ......
ÔÚjava.math°üÖÐÓиöBigDecimalÀ࣬ͨ¹ýÕâ¸öÀà¿ÉÒÔ½øÐо«È·¼ÆËã. ÎÒÃÇÖªµÀBigDecimalÓиösetScale(int ¾«¶È,int ÉáÈëģʽ)·½·¨£¬ËæÖ®¶øÀ´ÎÊÌâ³öÏÖÁË£¬µ±ÔËÐÐÈçÏ´úÂëʱ£º
/**
* @author troy(J2EE)
* @version 1.0
*/
import java.math.*;
public class Test{
& ......
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
/**
ÎļþÃû£ºFileEncrypter.java
JDK£º1.40ÒÔÉÏ
˵Ã÷£ºÎļþ¼ÓÃÜ
¼ÓÃÜ·½·¨£ºÈýÖØDES¼ÓÃÜ
¼ÓÃܹý³Ì£º¶ÔÑ¡ÖеÄÎļþ¼ÓÃܺóÔÚͬÎļ ......
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......