﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-老菜鸟的笔记本-文章分类-j2me</title><link>http://www.blogjava.net/ghostdog/category/32038.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 24 Jun 2008 03:20:21 GMT</lastBuildDate><pubDate>Tue, 24 Jun 2008 03:20:21 GMT</pubDate><ttl>60</ttl><item><title>j2me中的对象循环使用情况-todo</title><link>http://www.blogjava.net/ghostdog/articles/210260.html</link><dc:creator>鬼狗</dc:creator><author>鬼狗</author><pubDate>Tue, 24 Jun 2008 03:12:00 GMT</pubDate><guid>http://www.blogjava.net/ghostdog/articles/210260.html</guid><wfw:comment>http://www.blogjava.net/ghostdog/comments/210260.html</wfw:comment><comments>http://www.blogjava.net/ghostdog/articles/210260.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ghostdog/comments/commentRss/210260.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ghostdog/services/trackbacks/210260.html</trackback:ping><description><![CDATA[Canvas：<br />
Specific to Nokia's S60 devices, and possibily applicable to other Symbian devices as well: do not create multiple instances of Canvas, as it is a high-overhead object whose native implementation creates RWindow and RBackupWindow instances, which are heavyweight objects, in heap memory. Each new Canvas creates a new "RWindow" and this is know to exhaust memory pretty quickly.<br />
<br />
I agree with previous poster that writing in big chunks is better than both saving everything at once or writing multiple small chunks. Perhaps you could also use a new Thread for I/O operations and save-as-you-go pattern. That would avoid the memory spike as well.<br />
<br />
Images are problematic in some devices, I would only use PNG instead of JPEG, as they have smaller heap overhead.<br />
<br />
I have a presentation about optimization for S60 devices, not exclusively for games, but it can be of some help. Contact me if you need it.<br />
<br />
我现在的做法是即用即建，在n81和a1200上没未出现问题。 这个问题待核实。<br />
<br />
至于PNG比jpeg有更小的堆负担的情况，不祥。
<img src ="http://www.blogjava.net/ghostdog/aggbug/210260.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ghostdog/" target="_blank">鬼狗</a> 2008-06-24 11:12 <a href="http://www.blogjava.net/ghostdog/articles/210260.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>