<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
    謝謝分享,不錯的建議。
    主站蜘蛛池模板: 在线观看国产区亚洲一区成人| 亚洲爱情岛论坛永久| www.亚洲精品.com| 亚洲视频在线一区二区三区| 亚洲中文字幕无码av| 两个人看的www免费高清| 美女视频黄免费亚洲| 亚洲成AV人片在线播放无码| 日韩欧美亚洲中文乱码| 18未年禁止免费观看| 亚洲愉拍99热成人精品热久久| 亚洲gay片在线gv网站| 91在线老王精品免费播放| 青青青国产色视频在线观看国产亚洲欧洲国产综合 | 久久久久免费精品国产小说| 国产一级做a爱免费视频| 久久亚洲春色中文字幕久久久| 一级做a爰黑人又硬又粗免费看51社区国产精品视 | 亚洲国产精品成人AV无码久久综合影院| 亚洲色图黄色小说| 91黑丝国产线观看免费| 午夜亚洲www湿好大| 亚洲精品在线免费观看| 亚洲午夜福利在线视频| 免费成人黄色大片| 最新亚洲春色Av无码专区 | 成年女人18级毛片毛片免费观看| 久久综合日韩亚洲精品色| selaoban在线视频免费精品| 成人永久福利免费观看| 最新亚洲卡一卡二卡三新区| 四虎精品亚洲一区二区三区| 国产麻豆成人传媒免费观看| 国产亚洲精品线观看动态图| 色婷婷精品免费视频| 国产免费黄色大片| 国产成年无码久久久免费| 亚洲综合精品香蕉久久网| 2019中文字幕在线电影免费| 亚洲精品国产精品| 久久亚洲国产成人亚|