Memory not freed
See original GitHub issueI put an Image on FRX, Request ‘TestReport’ multiple times,My container footprint is 1GB or higher. Is there a problem with my code?
[Route("/TestReport")]
public string TestPrint(string type)
{
using Report report = new Report();
report.Load("3.frx");
using FileStream fs = new FileStream("1.png", FileMode.Open, FileAccess.Read);
byte[] buffur = new byte[fs.Length];
fs.Read(buffur, 0, (int)fs.Length);
fs.Close();
using ImageExport image = new ImageExport();
image.ImageFormat = ImageExportFormat.Jpeg;
image.Resolution = 300;
var data = new List<object>() { new { Image = buffur } };
report.RegisterData(data, "Test");
report.Prepare();
using MemoryStream reportImageStream = new MemoryStream();
report.Export(image, reportImageStream);
return Convert.ToBase64String(reportImageStream.ToArray());
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (7 by maintainers)
Top Results From Across the Web
Memory not freed after calling free() - malloc
Yes, I mean ps. After freeing the memory taken by the list, the OS still is out of memory. When more memory is...
Read more >Using Memory Leak Checking
Memory leaks can be avoided by following a good programming practice of always freeing memory when it is no longer needed and paying...
Read more >what happens when you don't free memory after using ...
If free() is not used in a program the memory allocated using malloc() will be de-allocated after completion of the execution of the...
Read more >What happens if you don't free memory? : r/C_Programming
If a file or function is reused in another program, which has different memory requirements or runs on a different platform, not freeing...
Read more >CWE-590: Free of Memory not on the Heap
The product calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Ramoshuai I tried the solution and it works fine the container memory went down to ~200MB
This is my current Dockerfile, may be it can be better but this is what worked with me.
I haven’t tried the latest version yet, but for the version I’m using “2021.4.13” it was the issue and building it using that dockerfile worked fine for me.