How to free up memory?

前端 未结 6 804
鱼传尺愫
鱼传尺愫 2021-02-12 22:17

We have been facing Out of Memory errors in our App server for sometime. We see the used heap size increasing gradually until finally it reaches the available heap in size. This

6条回答
  •  Happy的楠姐
    2021-02-12 22:44

    There is no specific to free up objects allocated in JSPs, at least as far as I know. Rather than investigationg such options, I'd rather focus on finding the actual problem in your application codes and fix it.

    Some hints that might help:

    • Check the scope of your beans. Aren't you e.g. storing something user or request specific into "application" scope (by mistake)?
    • Check settings of web session timeout in your web application and appserver settings.
    • You mentioned the heap consumption grows gradually. If it's indeed so, try to see by how much the heap size grows with various user scenarios: Grab a heapdump, run a test, let the session data timeout, grab another dump, compare the two. That might give you some idea where do the objects on heap come from
    • Check your beans for any obvious memory leaks, for sure :)

    EDIT: Checking for unreleased static resources that Daniel mentions is another worthwhile thing :)

提交回复
热议问题