System.OutOfMemoryException Allocating byte array.

T

The Sourcerer

Hi,

I am trying to allocate a byte array i na console app.
The process jumps over the 1 GB RAM and then throws
System.OutOfMemoryException.

It happens with diffrent sizes of allocation, on different computers,
using Framework 1.1.

Any ideas ?

Code:

static void Main(string[] args)
{
try
{
// Allocate Buffer in X Size ( Many X Discovered )
byte[] buffer = new byte[16776576];
// byte[] buffer = new byte[16776577]; // Another Example
// byte[] buffer = new byte[16776587]; // Another Example
// byte[] buffer = new byte[25161696]; // Another Example

// mote then 1 G of RAM is allocated here!
}
catch (Exception ex)
{

// Gives: System.OutOfMemoryException: Exception of type
System.OutOfMemoryException was thrown.
Console.WriteLine(ex.ToString());
Console.ReadLine();
}
}
}
 
C

Chris Lyon [MSFT]

Hi Sourcerer

The issue you have described is a known memory limitation in v1.1. It should be fixed in the upcoming Service Pack 1.

Sorry about the inconvenience. If this is a pressing issue, please contact Microsoft Support for a hotfix.

Thanks
-Chris

--------------------
From: (e-mail address removed) (The Sourcerer)
Newsgroups: microsoft.public.dotnet.languages.csharp
Subject: System.OutOfMemoryException Allocating byte array.
Date: 29 Feb 2004 10:51:50 -0800
Organization: http://groups.google.com
Lines: 35
Message-ID: <[email protected]>
NNTP-Posting-Host: 82.80.57.231
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1078080710 8950 127.0.0.1 (29 Feb 2004 18:51:50 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Sun, 29 Feb 2004 18:51:50 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com! nntp.giganews.com!news.glorb.com!postnews1.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:225179
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Hi,

I am trying to allocate a byte array i na console app.
The process jumps over the 1 GB RAM and then throws
System.OutOfMemoryException.

It happens with diffrent sizes of allocation, on different computers,
using Framework 1.1.

Any ideas ?

Code:

static void Main(string[] args)
{
try
{
// Allocate Buffer in X Size ( Many X Discovered )
byte[] buffer = new byte[16776576];
// byte[] buffer = new byte[16776577]; // Another Example
// byte[] buffer = new byte[16776587]; // Another Example
// byte[] buffer = new byte[25161696]; // Another Example

// mote then 1 G of RAM is allocated here!
}
catch (Exception ex)
{

// Gives: System.OutOfMemoryException: Exception of type
System.OutOfMemoryException was thrown.
Console.WriteLine(ex.ToString());
Console.ReadLine();
}
}
}


--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
 
T

The Sourcerer

Hi Chris !

Thanks for your reply !

I contacted ny TAM @ Microsoft, But it would be easier to get the hotfix
if I knew a KB article number or the hotfix ID.
Do you have it by any chance ?

Thanks,

The Sourcerer.





Hi Sourcerer

The issue you have described is a known memory limitation in v1.1. It should be fixed in the upcoming Service Pack 1.

Sorry about the inconvenience. If this is a pressing issue, please contact Microsoft Support for a hotfix.

Thanks
-Chris

--------------------
From: (e-mail address removed) (The Sourcerer)
Newsgroups: microsoft.public.dotnet.languages.csharp
Subject: System.OutOfMemoryException Allocating byte array.
Date: 29 Feb 2004 10:51:50 -0800
Organization: http://groups.google.com
Lines: 35
Message-ID: <[email protected]>
NNTP-Posting-Host: 82.80.57.231
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1078080710 8950 127.0.0.1 (29 Feb 2004 18:51:50 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Sun, 29 Feb 2004 18:51:50 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com! nntp.giganews.com!news.glorb.com!postnews1.google.com!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:225179
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Hi,

I am trying to allocate a byte array i na console app.
The process jumps over the 1 GB RAM and then throws
System.OutOfMemoryException.

It happens with diffrent sizes of allocation, on different computers,
using Framework 1.1.

Any ideas ?

Code:

static void Main(string[] args)
{
try
{
// Allocate Buffer in X Size ( Many X Discovered )
byte[] buffer = new byte[16776576];
// byte[] buffer = new byte[16776577]; // Another Example
// byte[] buffer = new byte[16776587]; // Another Example
// byte[] buffer = new byte[25161696]; // Another Example

// mote then 1 G of RAM is allocated here!
}
catch (Exception ex)
{

// Gives: System.OutOfMemoryException: Exception of type
System.OutOfMemoryException was thrown.
Console.WriteLine(ex.ToString());
Console.ReadLine();
}
}
}
 
T

The Sourcerer

Hi Chris !

Thanks for your reply.
I contacted my TAM @ Microsoft,
But it would be easier to get the hotfix
If you can tell me it's number / KB article or something like that...

Can you help by giving me the details if you have them ?

Thanks,

The Sourcerer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top