<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
    謝謝分享,不錯的建議。
    主站蜘蛛池模板: 精品亚洲aⅴ在线观看| 免费观看四虎精品国产永久| 毛片在线全部免费观看| 91精品国产免费网站| 大地资源二在线观看免费高清| 凹凸精品视频分类国产品免费| 亚洲av日韩精品久久久久久a| 特级毛片aaaa级毛片免费| 午夜不卡久久精品无码免费| 在线不卡免费视频| 国产V亚洲V天堂无码久久久| 亚洲av无码专区青青草原| 哒哒哒免费视频观看在线www| 久久亚洲sm情趣捆绑调教| 两性色午夜视频免费播放| 国产性生交xxxxx免费| 亚洲一区二区三区在线| 久久国产乱子伦精品免费强| 亚洲第一精品在线视频| 国产免费高清69式视频在线观看| 超pen个人视频国产免费观看| 亚洲高清在线视频| 深夜a级毛片免费无码| 一二三四在线观看免费高清中文在线观看 | 亚洲国产精品无码久久98| 亚洲视频免费一区| 狠狠色伊人亚洲综合成人| 日韩毛片一区视频免费| 久久亚洲国产精品一区二区| 99爱在线观看免费完整版| 相泽南亚洲一区二区在线播放| 久别的草原电视剧免费观看| 成人亚洲综合天堂| 99久久婷婷国产综合亚洲| 亚洲成年人免费网站| 亚洲乱亚洲乱妇24p| 在线播放免费人成视频在线观看| 午夜亚洲乱码伦小说区69堂| 国产免费观看网站| 久久久久久成人毛片免费看| 在线a亚洲老鸭窝天堂av高清|