<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
    謝謝分享,不錯的建議。
    主站蜘蛛池模板: 国产在线98福利播放视频免费| 国产国产人免费视频成69堂| 国产成人免费片在线视频观看| 国产成+人+综合+亚洲专| 国产香蕉免费精品视频| 亚洲AV成人一区二区三区在线看| 国产日本一线在线观看免费| 亚洲中文无码卡通动漫野外| 精品免费国产一区二区| 黄床大片30分钟免费看| 国产成人精品曰本亚洲79ren| 中文字幕高清免费不卡视频| 亚洲国产精品人久久| 亚洲综合免费视频| 亚洲综合激情五月色一区| 日本19禁啪啪无遮挡免费动图| 男男gvh肉在线观看免费| 在线亚洲精品自拍| 久久午夜伦鲁片免费无码| 亚洲成人免费电影| 国产无遮挡裸体免费视频| 一二三区免费视频| 亚洲精品国产成人专区| 免费av欧美国产在钱| 豆国产96在线|亚洲| 亚洲一区AV无码少妇电影☆| 97精品免费视频| 久久亚洲精品11p| 亚洲日本va在线视频观看| 37pao成人国产永久免费视频| 亚洲欧美成人av在线观看| 国产精品亚洲玖玖玖在线观看 | 国产成人综合亚洲AV第一页| 日韩中文字幕免费视频| 亚洲色成人四虎在线观看| 国外亚洲成AV人片在线观看| 18勿入网站免费永久| 一区免费在线观看| 亚洲成人福利在线观看| 亚洲不卡无码av中文字幕| 午夜免费福利视频|