473,835 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

large arrays and system.outofmem oryexception

assuming I have 2GB memory. And 1.5GB available.

dim c1(,) as byte
redim c1(1000, 1024*1024)

throws system.outofmem oryexception. I'm like... huh? Initially I thought a
lot of space is taken up by GC. So, I up my memory to 4GB. Same thing....

So, I read microsoft documents on this type of exception. Doesn't help much.
They were saying to try and keep arrays to 64KB. But, that's not much to work
with.

I suspected that it's gotta do with 'available contiguous memory' and not
just the total available memory. For example,

redim c1(800, 1024*1024)
redim c2(200, 1024*1024)
may work but not...
redim c1(500, 1024*1024)
redim c2(500, 1024*1024)

can someone shed some light on this? Sound like a .net memory oddity. ASP
..net seems to have similar problem (not with arrays though)
Mar 29 '06 #1
6 4302
Chad,

If I have this kind of problems, than I start to investigate in what kind of
a table will work and in what format not.

However, probably is this what you are looking for.

http://msdn.microsoft.com/library/de...ram_tuning.asp

I hope this helps,

Cor

"chad" <ch**@discussio ns.microsoft.co m> schreef in bericht
news:3C******** *************** ***********@mic rosoft.com...
assuming I have 2GB memory. And 1.5GB available.

dim c1(,) as byte
redim c1(1000, 1024*1024)

throws system.outofmem oryexception. I'm like... huh? Initially I thought a
lot of space is taken up by GC. So, I up my memory to 4GB. Same thing....

So, I read microsoft documents on this type of exception. Doesn't help
much.
They were saying to try and keep arrays to 64KB. But, that's not much to
work
with.

I suspected that it's gotta do with 'available contiguous memory' and not
just the total available memory. For example,

redim c1(800, 1024*1024)
redim c2(200, 1024*1024)
may work but not...
redim c1(500, 1024*1024)
redim c2(500, 1024*1024)

can someone shed some light on this? Sound like a .net memory oddity. ASP
.net seems to have similar problem (not with arrays though)

Mar 29 '06 #2
hey Cor, thanks for the reply.
http://msdn.microsoft.com/library/de...ram_tuning.asp
Ah, the /3GB thing. Yes, that was the first thing I tried after upping the
memory from 2 to 4GB. Didn't work though. But, I seriously doubt that it's
got anything to do with total memory.

I think that .net just can't handle arrays that size :(

Before I upped the memory, outofmemoryexce ption crashed out at 800MB of
array size. After upping to 4GB, it's still 800MB. So, I don't think it's the
total physical memory. I investigated page file size too, as well as stopping
unnecessary processes. Same thing. Oh well, sounds like recoding is the way
to go. I'm just curious why it's like this.



"Cor Ligthert [MVP]" wrote:
Chad,

If I have this kind of problems, than I start to investigate in what kind of
a table will work and in what format not.

However, probably is this what you are looking for.

http://msdn.microsoft.com/library/de...ram_tuning.asp

I hope this helps,

Cor

"chad" <ch**@discussio ns.microsoft.co m> schreef in bericht
news:3C******** *************** ***********@mic rosoft.com...
assuming I have 2GB memory. And 1.5GB available.

dim c1(,) as byte
redim c1(1000, 1024*1024)

throws system.outofmem oryexception. I'm like... huh? Initially I thought a
lot of space is taken up by GC. So, I up my memory to 4GB. Same thing....

So, I read microsoft documents on this type of exception. Doesn't help
much.
They were saying to try and keep arrays to 64KB. But, that's not much to
work
with.

I suspected that it's gotta do with 'available contiguous memory' and not
just the total available memory. For example,

redim c1(800, 1024*1024)
redim c2(200, 1024*1024)
may work but not...
redim c1(500, 1024*1024)
redim c2(500, 1024*1024)

can someone shed some light on this? Sound like a .net memory oddity. ASP
.net seems to have similar problem (not with arrays though)


Mar 29 '06 #3
"chad" <ch**@discussio ns.microsoft.co m> schrieb:
Before I upped the memory, outofmemoryexce ption crashed out at 800MB of
array size. After upping to 4GB, it's still 800MB. So, I don't think it's
the
total physical memory. I investigated page file size too, as well as
stopping
unnecessary processes. Same thing. Oh well, sounds like recoding is the
way
to go. I'm just curious why it's like this.


IIRC ~ 800 MB was the per-process memory limit for .NET 1.*, and maybe still
is for .NET 2.0.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 29 '06 #4
> IIRC ~ 800 MB was the per-process memory limit for .NET 1.*, and maybe still
is for .NET 2.0.
oh I see. that explains it then :-)
thank you very much.

"Herfried K. Wagner [MVP]" wrote:
"chad" <ch**@discussio ns.microsoft.co m> schrieb:
Before I upped the memory, outofmemoryexce ption crashed out at 800MB of
array size. After upping to 4GB, it's still 800MB. So, I don't think it's
the
total physical memory. I investigated page file size too, as well as
stopping
unnecessary processes. Same thing. Oh well, sounds like recoding is the
way
to go. I'm just curious why it's like this.


IIRC ~ 800 MB was the per-process memory limit for .NET 1.*, and maybe still
is for .NET 2.0.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 29 '06 #5
"chad" <ch**@discussio ns.microsoft.co m> schrieb:
IIRC ~ 800 MB was the per-process memory limit for .NET 1.*, and maybe
still
is for .NET 2.0.


oh I see. that explains it then :-)


Additional information on this topic can be found here (text is in German,
but links reference articles written in English):

<URL:http://groups.google.d e/group/microsoft.publi c.de.german.ent wickler.dotnet. csharp/msg/1e14bd8b0886e36 c>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 29 '06 #6
<URL:http://groups.google.d e/group/microsoft.publi c.de.german.ent wickler.dotnet. csharp/msg/1e14bd8b0886e36 c>

Awesome! Especially the 2nd article. It explains a lot about memory issues.

thanks again. You're the best :-)
"Herfried K. Wagner [MVP]" wrote:
"chad" <ch**@discussio ns.microsoft.co m> schrieb:
IIRC ~ 800 MB was the per-process memory limit for .NET 1.*, and maybe
still
is for .NET 2.0.


oh I see. that explains it then :-)


Additional information on this topic can be found here (text is in German,
but links reference articles written in English):

<URL:http://groups.google.d e/group/microsoft.publi c.de.german.ent wickler.dotnet. csharp/msg/1e14bd8b0886e36 c>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Mar 30 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2784
by: Per Bergland | last post by:
After many woes, I finally managed to get a stack dump of my System Service (written in C#) that insists on crashing when launched at system boot time (see below on how to get this dump - I couldn't find any info on how to do this). Here's the stack trace from cordbg: Unhandled exception generated: (0x04719c94) <System.Runtime.Remoting.RemotingException> _className=<null> _exceptionMethod=<null>
3
6162
by: Mohd Banat | last post by:
hello, I get XXX when I run the following code (if and only if the outcome of transformation is beyond 20 MB) With _Xslt .Load(XslFile) .Transform(XmlDocument, Nothing, MyWriter, Nothing)
2
3278
by: Fernando Casero | last post by:
Hi, I'm programming on Visual C# Express Beta 2 and I have the following code: class MyClass { int a = new int int b = new int public int SomeMethod() }
9
35325
by: haibhoang | last post by:
I have a Windows Service that is trying to parse a large (> 1Gig) text file. I am keep getting OutOfMemoryException exception. Here is the code that's having problem: using (StreamReader streamReader = new StreamReader(stream, Encoding.ASCII)) { string line = ""; DateTime currentDate = DateTime.Now.Date; while (streamReader.Peek() > -1)
1
3455
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
1
4997
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.
1
3902
by: Ashkan Daie | last post by:
Hi All, When trying to install a performance counter via InstallUtil I get the following exception: Creating performance counter category Enterprise Library Caching. An exception occurred during the Install phase. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was
2
4313
by: =?Utf-8?B?SnVzdCBjbG9zZSB5b3VyIGV5ZXMgYW5kIHNlZQ== | last post by:
Hello All i am trying to read a large txt files -may 1 GB-, which coze my program to hang, and i need to know if there are techniques that make this without hang and do it faster if you know something can help. please tell me. that is my code , and i had run it for a txt file its size is 423 MB, and i left my PC opened and in the next day i found that it records about 10 hours and large number of lines about 500000 line and also i got...
8
12580
by: =?Utf-8?B?UGlnZ3k=?= | last post by:
Hi to all, I am getting this System.OutOfMemoryException calling the Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(<stream>,<Obj>) method. The type of <streamis IO.MemoryStream =====Exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
0
9803
marktang
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...
0
9652
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,...
1
10560
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,...
1
7766
isladogs
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...
0
5636
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4433
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
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3088
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.