Resolve memory after using memory in Stimulsoft .Net - Memory Leak
Posted: Mon Dec 12, 2022 7:14 am
We have an application with a Stimulsoft .Net server to generate the reports.
We find that every time we generate another report the memory usage goes up. This is both virtual memory and physical memory. After many times of doing this, we managed to get the memory usage of more than 800MB (both virtual and physical), then we'd get memory errors.
It means It is working fine, but it's leaving a memory leak every time this function is executed
The detail:
I try to add some code to clear data but not works:
1. Using the Clear method
2. Dispose()
3. GC.Collect()
stiReport.Dictionary.DataStore.Clear();
stiReport.CompiledReport.DataStore.Clear();
stiReport.RenderedPages.Clear();
StiCacheCleaner.Clean(stiReport);
stiReport.Dispose();
stiReport = null;
//Forza il garbage collector a liberare la memoria allocata dall'assembly e dai dati
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
Could anyone please help me? How do we resolve the memory?
We find that every time we generate another report the memory usage goes up. This is both virtual memory and physical memory. After many times of doing this, we managed to get the memory usage of more than 800MB (both virtual and physical), then we'd get memory errors.
It means It is working fine, but it's leaving a memory leak every time this function is executed
The detail:
- Main method handle: GetStimulsoftReport and GetMergedStimusoftReportByLanguage
- Just start the model, not call any request
- Click call some requests:
Unmanaged memory hight and not resolve
Take more memory for SitTex, String, byte[],….
I try to add some code to clear data but not works:
1. Using the Clear method
2. Dispose()
3. GC.Collect()
stiReport.Dictionary.DataStore.Clear();
stiReport.CompiledReport.DataStore.Clear();
stiReport.RenderedPages.Clear();
StiCacheCleaner.Clean(stiReport);
stiReport.Dispose();
stiReport = null;
//Forza il garbage collector a liberare la memoria allocata dall'assembly e dai dati
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
Could anyone please help me? How do we resolve the memory?