<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    讓變化成為計劃的一部分

    歡迎大家探討本Blog涉及的所有軟件課題。我的Google Talk ID:zhengyun(at)gmail.com。

    我最希望軟件帶給用戶的感受是:美好的體驗、舒適感、簡約、干凈...

    posts - 32, comments - 8, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理
    不知道大家有否看過“反編譯的西伯利亞攻擊源代碼”的代碼,okay,不知道它的權威性有多大,不過西伯利亞攻擊這個游戲還是有名氣的,也許值得一看。
    它的主引擎就是聲明一個靜態的圖片數組:
    class MainEngine extends FullCanvas
        
    implements Runnable
    {
    。。。。
        
    static Image imgs[];
        
    public static void initImage() {
          
    if (!isLoadImg) {
            
    if(imgs == null)
                imgs 
    = new Image[GameData.imgName.length];
            
    for (int i = 0; i < GameData.imgName.length - 1; i++{
              
    if (imgs[i] == null{
                
    try {
                  imgs[i] 
    = Image.createImage("/" + GameData.imgName[i]);
                }

                
    catch (Exception ex) {
                  System.out.println(
    "i:"+i);
                  ex.printStackTrace();
                }

              }

              percent 
    = (i * 100/ (GameData.imgName.length - 1);
              Sib.engine.flushGraphic();
            }

            isLoadImg 
    = true;
          }

        }

    而且我搜索了它的5個java文件,它在什么情況下調用System.gc()呢?
    下面三種情況:
    用戶返回游戲時(可能之前去接聽電話了?或者去設置里改參數了?);
    用戶選完飛機后,這可能是一個選項菜單,選飛機時所用到的資源可能以后在游戲中沒必要用,所以及時回收一下;
    顯示過關界面時,這時候有卡的現象,歡喜的用戶也不會在意的。

    除此之外就沒有了。

    Nokia 的文檔Known Issues In The Nokia 6600 MIDP 2.0 Implementation v1.7說:
    2.15.1 Garbage collecting
    Description
    Calling the System.gc() method results in extreme slowness and jamming. In Monty 1.0 VM, garbage
    collection is different and every time System.gc is called, the entire memory is really cleared.
    This is an extremely slow process!
    Solution
    Do not call the System.gc method at all, or call the System.gc() garbage collecting method only
    in non-time-critical situations, such as screen transitions, state transitions, pause states,
    etc. If the System.gc() method is used, it is recommended to add a short delay (~20-50 ms) after
    the method call to ensure the sufficient time for the garbage collection, as in the following

    example
    System.gc();
    Thread.sleep(delay); delay = 20-50 ms


    評論

    # re: 什么時候在游戲中調用System.gc()?[javaME]  回復  更多評論   

    2008-03-21 22:15 by univasity
    謝謝分享,不錯的建議。
    主站蜘蛛池模板: 99爱在线观看免费完整版| 亚洲人成人网站18禁| 香蕉国产在线观看免费| 四虎影视在线永久免费看黄| 亚洲性无码一区二区三区| 成人免费无码大片A毛片抽搐色欲| 亚洲成aⅴ人在线观看| 免费看片在线观看| 亚洲一区中文字幕在线观看| 1000部免费啪啪十八未年禁止观看| 亚洲网址在线观看你懂的| 999久久久免费精品播放| 亚洲欧洲尹人香蕉综合| 韩国免费一级成人毛片| 亚洲综合小说另类图片动图| 毛片a级毛片免费播放100| 亚洲成a∨人片在无码2023| 国产精品色午夜视频免费看| 深夜a级毛片免费视频| 91麻豆精品国产自产在线观看亚洲 | 怡红院亚洲怡红院首页| 人妻免费一区二区三区最新| 亚洲国产一区国产亚洲| 国内精品乱码卡1卡2卡3免费 | 国产成人福利免费视频| 四虎亚洲精品高清在线观看| 成年大片免费视频| 免费大片黄在线观看| 亚洲欧洲自拍拍偷午夜色无码| 日本一卡精品视频免费| 77777亚洲午夜久久多喷| 国产三级免费观看| 免费观看男人吊女人视频| 亚洲性69影院在线观看| 国产小视频免费观看| 在线观看特色大片免费网站| 亚洲国产综合第一精品小说| 国产a不卡片精品免费观看| 久草免费手机视频| 亚洲国产成人手机在线观看| 中文字幕亚洲乱码熟女一区二区 |