memory leaks
-
- Posts: 6
- Joined: Thu Dec 02, 2010 12:00 am
- Location: Sydney
memory leaks
we have recently adopted Stimulsoft reports and are now experiencing memory leaks with our application server. We have resorted to using an advanced memory profiler to help diagnose and it finds many faults in Stimulsoft. For example:
Undisposed instances (release resource)
This type has instances that have been garbage collected without being properly disposed. To improve memory/resource utilization, it is recommended that instances of this type are properly disposed. Disposing instances of this type will release resource and suppress finalization.
Stimulsoft.Report!Stimulsoft.Report.StiReportObjectStringConverter.ConvertStringToFont( string )
Stimulsoft.Report!Stimulsoft.Report.StiReportObjectStringConverter.StringToObject( string,Type )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.Deserialize( object,Stream,string )
Stimulsoft.Report!Stimulsoft.Report.SaveLoad.StiXmlReportSLService.Load( StiReport,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( StiReportSLService,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( string )
Undisposed instances (memory/resource utilization)
This type has instances that have been garbage collected without being properly disposed. To improve memory/resource utilization, it is recommended that instances of this type are properly disposed. Disposing instances of this type will dispose other instances, suppress finalization, and clear references.
Stimulsoft.Base!Stimulsoft.Base.Drawing.StiImageConverter.BytesToImage( byte[] )
Stimulsoft.Base!Stimulsoft.Base.Drawing.StiImageConverter.StringToImage( string )
Stimulsoft.Report!Stimulsoft.Report.StiReportObjectStringConverter.StringToObject( string,Type )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.Deserialize( object,Stream,string )
Stimulsoft.Report!Stimulsoft.Report.SaveLoad.StiXmlReportSLService.Load( StiReport,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( StiReportSLService,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( string )
I wonder if you might use a similar tool to make sure your code does not have memory leaks.
Undisposed instances (release resource)
This type has instances that have been garbage collected without being properly disposed. To improve memory/resource utilization, it is recommended that instances of this type are properly disposed. Disposing instances of this type will release resource and suppress finalization.
Stimulsoft.Report!Stimulsoft.Report.StiReportObjectStringConverter.ConvertStringToFont( string )
Stimulsoft.Report!Stimulsoft.Report.StiReportObjectStringConverter.StringToObject( string,Type )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.Deserialize( object,Stream,string )
Stimulsoft.Report!Stimulsoft.Report.SaveLoad.StiXmlReportSLService.Load( StiReport,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( StiReportSLService,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( string )
Undisposed instances (memory/resource utilization)
This type has instances that have been garbage collected without being properly disposed. To improve memory/resource utilization, it is recommended that instances of this type are properly disposed. Disposing instances of this type will dispose other instances, suppress finalization, and clear references.
Stimulsoft.Base!Stimulsoft.Base.Drawing.StiImageConverter.BytesToImage( byte[] )
Stimulsoft.Base!Stimulsoft.Base.Drawing.StiImageConverter.StringToImage( string )
Stimulsoft.Report!Stimulsoft.Report.StiReportObjectStringConverter.StringToObject( string,Type )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject( object,StiPropertyInfoCollection )
Stimulsoft.Base!Stimulsoft.Base.Serializing.StiSerializing.Deserialize( object,Stream,string )
Stimulsoft.Report!Stimulsoft.Report.SaveLoad.StiXmlReportSLService.Load( StiReport,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( StiReportSLService,Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( Stream )
Stimulsoft.Report!Stimulsoft.Report.StiReport.Load( string )
I wonder if you might use a similar tool to make sure your code does not have memory leaks.
memory leaks
Hello,
We couldn't reproduce this issue.
Which version of Stimulsoft Reports do you use?
Can you please send us a sample report with data or a simple test application, which reproduce the issue?
Thank you.
We couldn't reproduce this issue.
Which version of Stimulsoft Reports do you use?
Can you please send us a sample report with data or a simple test application, which reproduce the issue?
Thank you.
-
- Posts: 6
- Joined: Thu Dec 02, 2010 12:00 am
- Location: Sydney
memory leaks
As background, we were using Crystal reports which were very unstable, and the functionality of Stimulsoft is great - we are overall very happy with it. But we have noticed that our application server is creeping memory, and we have done many tests locally with advacned memory profilers - if we run our applictions without any reports all is well, but as soon as we use a report there is a small leak.
Here is the code we use:
Running with the ExportDocument line commented still results in the leak.
I have attached a sample report as well.
Here is the code we use:
Code: Select all
using (StiReport report = new StiReport())
{
try
{
report.Load(reportFile);
report.DataSources.Clear();
report.Dictionary.Databases.Clear();
report.Dictionary.ImportXMLSchema(data);
report.RegData(data);
Stimulsoft.Report.Export.StiPdfExportSettings settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
settings.Compressed = true;
settings.EmbeddedFonts = false;
settings.ImageQuality = 0.40f;
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf, pdfFileName, settings);
report.Dictionary.DataStore.Clear();
data.Clear();
data.Dispose();
report.Dispose();
ok = true;
}
catch (FormatException fex)
{
host.setMessageToken(1, fex.Message);
host.setMessageToken(2, reportFile);
host.addSystemMessage(UserMessage.Severity.Error, reportFile+": Format Exception:" + fex.Message, "RPT_FormatException");
ok = false;
}
catch (Exception ex)
{
host.setMessageToken(1, ex.Message);
host.setMessageToken(2, reportFile);
host.addSystemMessage(UserMessage.Severity.Error, reportFile+": There is a problem with the data sent to the report:" + ex.Message, "RPT_Exception");
ok = false;
}
}
I have attached a sample report as well.
- Attachments
-
- 738.TMXInvoice.mrt
- (155.3 KiB) Downloaded 525 times
memory leaks
Hello,
We cannot reproduce the issue in our data.
Can you provide data for your report, which reproduces the issue?
Thank you.
We cannot reproduce the issue in our data.
Can you provide data for your report, which reproduces the issue?
Thank you.
-
- Posts: 6
- Joined: Thu Dec 02, 2010 12:00 am
- Location: Sydney
memory leaks
Here is a first cut of a self contained application that can demonstrate this problem.
Over time, as you GC.Collect(), the memory will always be reclaimed. If however you run a report, some memory is lost and never reclaimed. As our application servers must be available 24x7, this manifests into a real problem. Over many years we have never had memory leaks as the .NET GC reclaims it.
I will use an advanced memory profiler to report exactly where the leak occurs.
Our senior architect used reflector and said your Finalizer() in the Render() method was very large and was most likely the source of the leak.
Over time, as you GC.Collect(), the memory will always be reclaimed. If however you run a report, some memory is lost and never reclaimed. As our application servers must be available 24x7, this manifests into a real problem. Over many years we have never had memory leaks as the .NET GC reclaims it.
I will use an advanced memory profiler to report exactly where the leak occurs.
Our senior architect used reflector and said your Finalizer() in the Render() method was very large and was most likely the source of the leak.
memory leaks
Hello,
We are working on this issue. We will let you know when the solution is available.
Thank you.
We are working on this issue. We will let you know when the solution is available.
Thank you.
memory leaks
Hello,
Please check the following topic on our forum:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=142
For select this mode, please set the CalculationMode property of the report:
Thank you.
Please check the following topic on our forum:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=142
Also you can try to test the new Interpretation mode of report rendering.I need describe some principles of the functioning the StimulReport.Net.
1. Source code of the report is formed. Forming based on the grounds of meta description of the report
2. This source code is compiled in to assembly
3. Assembly is loaded in to memory
4. Create object of the report from loaded assemblies
5. Report is rendered
6. Report is showed
The loaded assembly occupies place in memories. If ten once produce compiling the report,
that will be ten are once created assembly of the report and loaded in memory. How to correct?
Regrettably .Net Framework does not give the possibility to unload the assembly from memory
(only together with application domain, but this method has much restrictions).
1. Save the report as class and add it to project. In this case compiling occurs
together with project.
2. Save the report as assembly. Before building of the report its necessary to load
from assembly with method StiReport.GetReportFromAssembly.
For select this mode, please set the CalculationMode property of the report:
Code: Select all
report.CalculationMode = StiCalculationMode.Interpretation;
memory leaks
Ivan wrote:
Also you can try to test the new Interpretation mode of report rendering.
For select this mode, please set the CalculationMode property of the report:
Thank you.Code: Select all
report.CalculationMode = StiCalculationMode.Interpretation;
I have also problems with memory.
When I try calculation mode Interpretation, I have an error message: "Syntax error near }" I have many "}" on my report. How I can know where is the error?
If calculation mode is Compilation, I have no error. But after 100 - 120 reports, my program hangs for memory consumption.
Thank you
memory leaks
Hello,
Thank you.
Can you please send us a sample report with data, which reproduce the issue?Mpanal wrote:When I try calculation mode Interpretation, I have an error message: "Syntax error near }" I have many "}" on my report. How I can know where is the error?
If calculation mode is Compilation, I have no error. But after 100 - 120 reports, my program hangs for memory consumption.
Thank you.
memory leaks
Ivan wrote:Hello,
Can you please send us a sample report with data, which reproduce the issue?Mpanal wrote:When I try calculation mode Interpretation, I have an error message: "Syntax error near }" I have many "}" on my report. How I can know where is the error?
If calculation mode is Compilation, I have no error. But after 100 - 120 reports, my program hangs for memory consumption.
Thank you.
Hello,
I can send you the report, but the data is very difficult because is a very complex report that reads data from a SQLserver on many tables, with different languages, and also, an user data table thats fills on the fly from the program. Also, from the program is filled many variables on the report.
On the Visual Studio, On the form design, If I click on Show report on rigght button menu of the report, I can reproduce the error without data.
Tell me an email for send you the report.
Thank you