[Design] Memory Consumption Design

773阅读 0评论2011-12-05 web_surf
分类:项目管理

  1. Use cache
    If there are a lot of objects to be allocated and released frequently, you can use cache techinique to record released objects, and reuse them in future.

    Be careful:
    - You must set a capacity that at most the specified number of objects can be recorded in cache; otherwise, cache will consume to many memory.
    - You must design a policy to release some/all cached objects when system is in low memory.
  2. Use chunk
    If you need a buffer to append/remove elements frequently, you can split the buffer to multiple chunks. more details, please refer to another thread 'Buffer design'.
  3. xxx
上一篇:[Design] Buffer design
下一篇:[Web] Offline Web App (application cache)