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

JavaÐéÄâ»úÄÚ´æµ÷Õû

JavaÐéÄâ»úĬÈÏ·ÖÅä64MÄڴ棬Èç¹ûÄãµÄÓ¦ÓñȽϴ󣬳¬³ö64MÄڴ棬JavaÐéÄâ»ú¾Í»áÅ׳öOutOfMemoryError£¬²¢Í£Ö¹ÔËÐС£²»¹ÜÊÇʲôӦÓã¨WebÓ¦Óá¢ApplicationµÈ£©£¬Ö»ÐèÒªÐÞ¸ÄÄãµÄ»úÆ÷ÉϵÄÔËÐÐJavaÃüÁÔÚjava xxxÃüÁîÖÐÌí¼Ó-Xms(×îСʹÓÃÄÚ´æ)¡¢-Xmx£¨×î´óʹÓÃÄڴ棩¼´¿É½â¾ö¡£µ±È»£¬Õâ¶ùµÄÄÚ´æÈÝÁ¿¶¼ÊÇÖ¸ÎïÀíÄڴ棬²»Äܳ¬³öÄãµÄ»úÆ÷µÄÎïÀíÄÚ´æµÄ×ÜÈÝÁ¿¡£
¹ØÓÚÈçºÎÉèÖÃJVM²ÎÊý
ÔÚTomcat4.xÖУ¬¿ÉÒÔͨ¹ýÔÚ$TOMCAT/bin/catalina.batÖÐÉèÖÃ
CATALINA_OPTS²ÎÊýÀ´ÉèÖÃJVM²ÎÊý
±ÈÈç
set CATALINA_OPTS=-Xms256m -Xmx256m
                  -XX:NewSize=64m
                  -XX:MaxNewSize=64m
                  -XX:SurvivorRatio=10
²ÎÊýº¬ÒåÈçÏ£º
1£¬-Xms  ÉèÖÃJava heap(¶Ñ£©µÄ³õʼ»¯´óС
2£¬-Xmx  ÉèÖÃJava heap  µÄ×î´óÖµ
3£¬-XX:NewSize Èç¹û³õʼ»¯´óС²»×㣬°´Õմ˲ÎÊý¾ö¶¨ÐÂÔöµÄÄÚ´æ´óС
4£¬-XX:MaxNewSize ÉèÖÃ×î´ó¿ÉÒÔÐÂÔöÄÚ´æ
5,-XX:SurvivorRatio set the ration of nursery-to-surriovr space
ת×Ô£ºhttp://jeans.javaeye.com/blog/203086


Ïà¹ØÎĵµ£º

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 Test {
 /**
  * @param args
  */
 public static void main(String[] args) {
  /**
   * ÇóÖÊÊýºÍ£¬
   * Èç:
   * sum(1)=2=2
   * sum(2)=2+3=5
   * sum(3)=2+3+5=10
   * sum(4)=2+3+5+7=17
& ......

C#ÓëJAVAµÄ±È½Ï

ºÜ¶àÈË˵C#ÊÇ΢ÈíÓÃÀ´ºÍJava¿¹ºâµÄÎäÆ÷£¬ÒòΪ¶þÕßÔںܴó³Ì¶ÈÉÏÓÐמªÈ˵ÄÏàËÆ£¬¾¡¹ÜÈç´Ë£¬Á½Õß²»Í¬µÄµØ·½Ò²ºÜ¶à£¬Ëùν“ÓÚϸ΢´¦¼û²îÒ씡£ÄÇôÁ½ÕßµÄÏàËƺÍÇø±ð¶¼ÔÚʲôµØ·½ÄØ£¿ÎÒÃÇ´Ó½ñÌ쿪ʼ£¬»á´Ó¸÷¸ö½Ç¶ÈÀ´¶Ô±ÈC#ºÍJavaµÄÌص㣬ϣÍûÄܶÔÕýÔÚѧϰ¡¢Ê¹ÓÃC#µÄÅóÓÑÓÐËù°ïÖú¡£
& Y0 f! I! a4 a1 K
% B# G8 ......

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

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

java equalsÓë== µÄÇø±ð

equals ·½·¨ÊÇ java.lang.Object ÀàµÄ·½·¨¡£
ÓÐÁ½ÖÖÓ÷¨ËµÃ÷£º
£¨1£©¶ÔÓÚ×Ö·û´®±äÁ¿À´Ëµ£¬Ê¹ÓÓ==”ºÍ“equals()”·½·¨±È½Ï×Ö·û´®Ê±£¬Æä±È½Ï·½·¨²»Í¬¡£
“==”±È½ÏÁ½¸ö±äÁ¿±¾ÉíµÄÖµ£¬¼´Á½¸ö¶ÔÏóÔÚÄÚ´æÖеÄÊ×µØÖ·¡£
“equals()”±È½Ï×Ö·û´®ÖÐËù°üº¬µÄÄÚÈÝÊÇ·ñÏàͬ¡£
±ÈÈ磺 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ