yasser777 / nettiers

Automatically exported from code.google.com/p/nettiers
0 stars 0 forks source link

Out of memory exception when generating too many stored procedures #350

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enter a value in the CustomProcedureStartsWith property that will result in 
> 800 stored procedures to be included in the code generation.
2. Click play and watch for the *File Created: Procedures.xml in the output 
window. The error should occur.

*Note: The actual number of stored procedures is not as relevant as the amount 
of data that can be handled. Even a few stored procedures that are very long 
would also cause this error. In the SQL db I tested against there were 865 
stored procedures.

What is the expected output? 
A warning that too many custom stored procedures were selected. Or somehow 
handle such a large number of stored procedures.

What do you see instead?
Exception of type 'System.OutOfMemoryException' was thrown.

What version of .netTiers and CodeSmith are you using?
.netTiers: 2.3-r852 
CodeSmith: 5.2.2-r11561

Additional information: 
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' 
was thrown.
   at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)
   at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)
   at System.Text.StringBuilder.Append(String value)
   at System.IO.StringWriter.Write(String value)
   at CodeSmith.Engine.CodeTemplateWriter.Write(String value)
   at _CodeSmith.NetTiers_cst.StoredProceduresXml.__RenderMethod1(TextWriter writer, Control control) in d:\Development\Temp\CodeSmith NetTiers_Latest\DataAccessLayer.SqlClient\StoredProceduresXml.cst:line 924
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile, Boolean overwrite)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(String path, Boolean overwrite)
   at _CodeSmith.NetTiers_cst.RenderToFile(String templateName, String path, Boolean overwrite) in d:\Development\Temp\CodeSmith NetTiers_Latest\NetTiers.cst:line 725
   at _CodeSmith.NetTiers_cst.Go() in d:\Development\Temp\CodeSmith NetTiers_Latest\NetTiers.cst:line 2032
   at _CodeSmith.NetTiers_cst.__RenderMethod1(TextWriter writer, Control control) in d:\Development\Temp\CodeSmith NetTiers_Latest\NetTiers.cst:line 5750
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at ej.s()

Original issue reported on code.google.com by xk...@yahoo.com on 15 Oct 2010 at 7:03

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 15 Oct 2010 at 1:30

GoogleCodeExporter commented 9 years ago
Hello,

I think that this is more of an issue with Memory Management in Windows/.NET 
Framework. How much ram do you have on the system? Can you increase it? Please 
take a look at the following official post from Microsoft on this issue 
(http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/10/10/stringbuilder-outo
fmemoryexception.aspx).

I don't think this is something you can fix unless you add more ram to your 
system or use a x64 operating system. If you can get me the reproduction steps. 
I'll see if we can create a work around or solution for this issue.

Thanks

-Blake Niemyjski

Original comment by bniemyjski on 28 Oct 2010 at 2:11

GoogleCodeExporter commented 9 years ago
This case references the following forum post: 
http://community.codesmithtools.com/nettiers/f/16/p/11473/43942.aspx#43942

Original comment by bniemyjski on 28 Oct 2010 at 2:11