dotnet / dotnet/Open-XML-SDK

Static cache takes up too much memory

Open
#1,062 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.6k
Forks
605
PR merge metrics
No merged PRs in 30d

Description

# Before submitting an issue, please fill this out

Is this a:
- [x] Issue with the OpenXml library
- [ ] Question on library usage

If you have answered that this is a question, please ask it on StackOverflow instead of here.
This issue tracker is meant to track product issues while StackOverflow excels at answering questions

---------------- Remove this line and above before posting ----------------

**Description**

I capture my application by dot Memory tool. And I find the OpenXML SDK take up too many memories to cache.

![](https://user-images.githubusercontent.com/16054566/140276905-2f298141-b624-4a95-9f98-201d780894c2.png)

My application will use the OpenXML SDK to read the file once, and it means that the cache in SDK is wasteful

**Information**

- .NET Target: ALL
- DocumentFormat.OpenXml Version: 2.13.0

**Repro**

Not special

**Observed**

The OpenXML SDK take up too many memories to cache.

**Expected**

We can free it manual.

Contributor guide

Open the contributing guide

Research direction

The report names no source file, test, or concrete reproduction beyond using OpenXML SDK 2.13.0 with a memory profiler. Start by reproducing the static-cache growth with the reported single-read scenario and trace the cache ownership in the SDK. Done means identifying the retained cache and providing a supported way to release it manually without breaking subsequent SDK use.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.