<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 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
    不知道大家有否看過“反編譯的西伯利亞攻擊源代碼”的代碼,okay,不知道它的權(quán)威性有多大,不過西伯利亞攻擊這個游戲還是有名氣的,也許值得一看。
    它的主引擎就是聲明一個靜態(tài)的圖片數(shù)組:
    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文件,它在什么情況下調(diào)用System.gc()呢?
    下面三種情況:
    用戶返回游戲時(可能之前去接聽電話了?或者去設置里改參數(shù)了?);
    用戶選完飛機后,這可能是一個選項菜單,選飛機時所用到的資源可能以后在游戲中沒必要用,所以及時回收一下;
    顯示過關界面時,這時候有卡的現(xiàn)象,歡喜的用戶也不會在意的。

    除此之外就沒有了。

    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: 什么時候在游戲中調(diào)用System.gc()?[javaME]  回復  更多評論   

    2008-03-21 22:15 by univasity
    謝謝分享,不錯的建議。
    主站蜘蛛池模板: 免费看美女让人桶尿口| 亚洲一区二区三区免费观看| 免费高清在线影片一区| 在线免费中文字幕| 久久免费香蕉视频| 边摸边吃奶边做爽免费视频99| 99久久精品国产亚洲| 亚洲中文字幕无码一久久区| 日本高清免费网站| 手机在线看永久av片免费| 久久精品无码精品免费专区| 在线播放国产不卡免费视频| 朝桐光亚洲专区在线中文字幕 | 精品韩国亚洲av无码不卡区| 亚洲国产日韩在线成人蜜芽| 亚洲一二成人精品区| 九月丁香婷婷亚洲综合色| 国产综合亚洲专区在线| 亚洲国产a级视频| 国产一区二区三区免费视频| 欧美在线看片A免费观看| 黄在线观看www免费看| 特级精品毛片免费观看| 久久国产精品免费观看| 久久精品免费观看| 嫩草在线视频www免费观看| 可以免费观看的毛片| 久久精品乱子伦免费| 日本不卡免费新一区二区三区| 中文字幕乱码一区二区免费| baoyu122.永久免费视频| a级成人毛片免费视频高清| 中文字幕无码免费久久9一区9| 国产A∨免费精品视频| 精品97国产免费人成视频| a免费毛片在线播放| 99久久99这里只有免费的精品| 国内永久免费crm系统z在线| 日本卡1卡2卡三卡免费| 四虎免费影院ww4164h| 男女超爽刺激视频免费播放|