Skip to content

Query reg a Cache causing OOM in 0.90.3 version #371

Description

@LogeswaranRamasamy

#264

This query is regarding this specific OOM which arised due to some Cache issue. We are currently using the 0.90.3 version & facing this issue.

Upon checking it appears the ThreadLocalCache created per iteration was uncleared causing memory retention & eventually OOM. To solve this I tried adapting the latest 0.91.X version jars but it has some issues in LRU Cache Size limit & element removal from Cache(reg which I will share a another issue shortly once I pentest it).

So meanwhile as a immediate workaround, I am planning to solve this issue in 0.90.3 by:

  1. Keeping a single instance of XMLConfig through the entire Application lifetime with the defaultSharedFormatCache() itself.//OOM Cause Think it will only cause OOM when we multiple XMLConfig instance each with it's own ThreadLocal filling up memory. If we use just single instance/few instance of XMLConfig throughout application lifetime, OOM will not occur right? Is this fix concrete?

  2. Obviously I suspect we cannot use formatCache = DefaultFormatCache() on a shared XML Config as it's not ThreadSafe & will lead to race conditions.

  3. We can use formatCache = FormatCache.Dummy but problem is that while processing large/multiple xml of .docx processing, I suspect FormatCache.Dummy might cause slowness in serialisation as it's requires re-computing the XmlDescriptor for every node causing slowness.

So, the viable fix appears to be using a Singleton/few instance of XMLConfig() throughout the entire application lifetime or keep XMLConfig instance based itself for each thread & instead use formatCache = DefaultFormatCache() to Cache only at individual thread level not at application level?

Which is the best solution to address this OOM issue in the 0.90.3 itself as immediate resolution as versions 0.91.X has some LRU Cache Size limit issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in devThe issue is fixed/implemented in the dev branch

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions