Hi,
There are several pages that occasionally start throwing
System.OutOfMem oryException and "The type initializer for
"Microsoft.Prac tices.Enterpris eLibrary.Data.I nstrumentation. DataCommandFail edEvent
exception."
The problem goes away after iisreset .
- Actually on Excel Exporting this error happens and stops all the
applications in the server
- It exceeds more than 1GB size, i hope so in server
-
How to solve this problem? How to reduce size of Dataset when exporting
to excel file?
Help me out in this...
Thanks in advance
-karups 5 7769
You may wish to clarify what exactly your code is doing... it isn't entirely
clear from the post.
Initial thoughts:
* Are you using Excel directly on the server? Yup, that might not scale so
well...
* Reduce the size of the DataSet =work with less data...
* ...or, work with a "streaming" approach rather than an "in memory"
approach - i.e. it loads a record ([or a few, or dozens, or hundreds, but
not millions] at a time) from the source, processes (writes?) that record /
those records, and *then* moves on. Think IDataReader, Stream, etc
Maybe if you can clarify what you are trying to achieve somebody can suggest
a better approach.
Marc
My application will have a fetch button.
As soon as we click the fetch button..It calls a Stored Procedure.
The stored procedure will return a dataset back(huge on with rows 25000
and col:52)...
I export this dataset to excel using this code
Response.Clear( );
Response.AddHea der("content-disposition",
"attachment;fil ename="+filenam e+".xls");
Response.Charse t = "";
this.EnableView State=false;
Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);
Response.Conten tType = "applicatio n/vnd.xls";
System.IO.Strin gWriter stringWrite = new System.IO.Strin gWriter();
System.Web.UI.H tmlTextWriter htmlWrite = new
HtmlTextWriter( stringWrite);
DataGrid myDataGrid=new DataGrid();
myDataGrid.Data Source=dsReport .Tables[1];
myDataGrid.Data Bind();
myDataGrid.Rend erControl(htmlW rite);
Response.Write( stringWrite.ToS tring());
Response.End();
While doing this i get the OutOfMemoryExce ption..
My application will have a fetch button.
As soon as we click the fetch button..It calls a Stored Procedure.
The stored procedure will return a dataset back(huge on with rows 25000
and col:52)...
I export this dataset to excel using this code
Response.Clear( );
Response.AddHea der("content-disposition",
"attachment;fil ename="+filenam e+".xls");
Response.Charse t = "";
this.EnableView State=false;
Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);
Response.Conten tType = "applicatio n/vnd.xls";
System.IO.Strin gWriter stringWrite = new System.IO.Strin gWriter();
System.Web.UI.H tmlTextWriter htmlWrite = new
HtmlTextWriter( stringWrite);
DataGrid myDataGrid=new DataGrid();
myDataGrid.Data Source=dsReport .Tables[1];
myDataGrid.Data Bind();
myDataGrid.Rend erControl(htmlW rite);
Response.Write( stringWrite.ToS tring());
Response.End();
While doing this i get the OutOfMemoryExce ption..
It seems to be well known issue, but the solution is not so trival
Obviously the reason is that your managed heap is overly fragmented that FW
couldn't find free 64mb heap segment to allocate memory.
There are several descriptions in the net about how to investigate this
problem, especially Tess blog (MS escalation engineer)
I recomend to read this recend article http://msdn.microsoft.com/msdnmag/is...t/default.aspx that
describes your aspect of problem
--
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
"karups" wrote:
My application will have a fetch button.
As soon as we click the fetch button..It calls a Stored Procedure.
The stored procedure will return a dataset back(huge on with rows 25000
and col:52)...
I export this dataset to excel using this code
Response.Clear( );
Response.AddHea der("content-disposition",
"attachment;fil ename="+filenam e+".xls");
Response.Charse t = "";
this.EnableView State=false;
Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);
Response.Conten tType = "applicatio n/vnd.xls";
System.IO.Strin gWriter stringWrite = new System.IO.Strin gWriter();
System.Web.UI.H tmlTextWriter htmlWrite = new
HtmlTextWriter( stringWrite);
DataGrid myDataGrid=new DataGrid();
myDataGrid.Data Source=dsReport .Tables[1];
myDataGrid.Data Bind();
myDataGrid.Rend erControl(htmlW rite);
Response.Write( stringWrite.ToS tring());
Response.End();
While doing this i get the OutOfMemoryExce ption..
Thank you.I read the article,That was useful information.
But can you tell me a way to rectify in my application if possible.. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cody |
last post by:
public DateTime Value
{
get
{
try
{
return new DateTime(int.Parse(tbYear.Text), int.Parse(tbMonth.Text),
int.Parse(tbDay.Text));
}
catch (FormatException)
|
by: Kevin Yu |
last post by:
is it a bad programming design to throw exception in the try block then
catch it??
|
by: Ripul Handa |
last post by:
Hi
We are running IIS 5.0 cluster with cisco local director.
We are running a website on 2 webservers and I have been
observing that from past few days we have are getting
this error message of and on
Error Messag
Remote IP:66.122.242.6
Host:216.211.212.2
|
by: Pete Davis |
last post by:
I have an app that's dealing with a few hundred bitmap thumbnails.
I only instantiate the bitmaps that are visible at a given time and dispose
of them if they get scrolled out of view. I've used the .NET memory profiler
and I've verified there's no leak in my bitmaps, nor are there any other
apparent leaks. So, at a given time, there may be 30 or so bitmaps displayed
at a given time.
Still, somehow, I'm getting random errors in the...
|
by: SMG - Idealake |
last post by:
Hi all,
I am getting following error on my error, what could be the reason?
Exception of type System.OutOfMemoryException was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Exception of type
System.OutOfMemoryException was thrown.
| |
by: elziko |
last post by:
I have a procedure that creates a bitmap of a certain size and then displays
it in a 3rd party component.
However, if the bitmap is very large then a System.OutOfMemoryException is
thrown my something but my codes breaks at the difition of my class:
"Public Class MainForm"
....so I'm assuming that the OutOfMemoryException occurs in the 3rd party
since I have put a Try-Catch block around my bitmap creation code and I am
|
by: karups |
last post by:
Hi,
There are several pages that occasionally start throwing
System.OutOfMemoryException and "The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent
exception."
The problem goes away after iisreset .
- Actually on Excel Exporting this error happens and stops all the
|
by: Don |
last post by:
When using Visual Basic .NET with a reference to Interop.Outlook, is there a
way to get more detailed information about an error other than
Exception.Message or Exception.ToString? For example, Outlook's
MailItem.SaveAs method can return an error message of "The operation
failed", but I have no idea what that means. As a test, I tried SaveAs using
a filename that contained illegal characters and got the error message
"Internal Application...
|
by: chandhrakv |
last post by:
Hi experts,
Can any one please respond with the resolution. Machine: WIN2K3, ASP.NET application, .NET 2.0 with June 2007 hotfix installed recently.
Facing daily 1000 errors with the same type hopefully. Please assist.
-----
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/18/2009 10:48:23 AM
Event time (UTC): 11/18/2009 5:18:23 AM
Event ID: 6418c83513d4492bb14bc36994b95996
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |