Savage F. Morgan

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年1月23日

摘要: Avoid Creating Unnecessary ObjectsObject creation is never free. A generational garbage collector with per-thread allocation pools for temporary objects can make allocation cheaper, but allocating memory is always more expensive than not allocating memory.As you allocate more objects in your app, yo 阅读全文
posted @ 2013-01-23 06:59 罗斯摩根 阅读(508) 评论(0) 推荐(0) 编辑

摘要: 首先解释下这句话This Handler class should be static or leaks might occur,大致意思就是说:Handler类应该定义成静态类,否则可能导致内存泄露。具体如何解决,在国外有人提出,如下:Issue: Ensures that Handler classes do not hold on to a reference to an outer classIn Android, Handler classes should be static or leaks might occur. Messages enqueued on the applic 阅读全文
posted @ 2013-01-23 00:19 罗斯摩根 阅读(14542) 评论(2) 推荐(0) 编辑