在j2me中使用System.gc的步骤

在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