站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2ME 专题j2me中使用System.gc()

j2me中使用System.gc()

摘要: j2me中使用System.gc()


开始学Java的时候就明白调用System.gc(),jvm并不会马上收集内存。
单在j2me环境中,适时的使用System.gc()是有用的。
两组数据对比:
--数据1-- --数据2--
now mem4:827792 now mem4:818460
now mem2:872904 now mem2:872488
now mem3:872904 now mem3:872488
now mem1:1102360 now mem1:871756
now mem4:1353920 now mem4:946456
now mem2:886776 now mem2:886764
now mem3:886776 now mem3:886764
now mem1:1313924 now mem1:884092
now mem4:1415412 now mem4:1092184
now mem2:903516 now mem2:903596
now mem3:903516 now mem3:903596

数据2在now mem2: 后使用了System.gc();数据为内存使用值。Nokia Series 60




↑返回目录
前一篇: 在J2ME客户端连续100次建立TCP连接并发送数据
后一篇: J2ME开发环境安装指南