Will memory get over-used?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Some codes instantiate an Arraylist and add many many objects to the list
before the code start to process the items and kill the object. (I assume
this could be a bad approach and I will need to find ways to improve the
design/performance)

But the question is: will this going to kill my system due to memory
overflow or something? I wonder if VB.net is designed to save my Arraylist
"contents" onto virtual memory (disk) once its size reaches certain limit.

Thank you.
 
I can't vouch for the first question, but the second, i can give a 99%
positive of NO. It won't kill your system. Windows manages the Swap
Memory, not the .Net framework, and so if needed, it will page it (And
increase the page file to the maximum size if it ever got that big!)
 
Wel probabaly your app run into an error before the windows max is reached
as an object running on the framework can only use about 2 gig of memory
 
Each *ITEM* in an arraylist is limited to 2GB..

Wel probabaly your app run into an error before the windows max is
reached as an object running on the framework can only use about 2 gig of
memory
 
there is currently a 2GB limit for all CLR objects, no matter what OS
you are running on 32 / 64 bit.


There is also a practical limit, dependent on the current system
conditions, (memory fragmentation ) that limits the growth to the largest
continguous block of memory available.


http://msdn2.microsoft.com/en-us/library/ms241064(VS.80).aspx
http://blogs.msdn.com/joshwil/archive/2005/08/10/450202.aspx


Please not the following even on a 64 bit system the object limit is 2 GB
so
however if the system has enough ram you can alocate multiple objects of 2
gb


on a 32 bit system you cannot allocate full 2 gb so there sure is an
advantage to have a 64 bit system and to compile in 64 bit modus



Michel
 
Sigh.. FFS... Here we go AGAIN.
there is currently a 2GB limit for all CLR objects, no matter what OS
you are running on 32 / 64 bit.

This is just plain WRONG.


By the way, your canned response is just as wrong this time as it was one
month ago when I corrected your mistakes:
http://groups.google.ca/group/micro...st&q=Michel+Posseth+[MCP]+object+size&rnum=7#

You are either a masochist, or have a poor memory.. Hmm I see a pattern
here -
problems with memory limits..


We already did this. This horse is dead..

If you quote an authoritative source, DO NOT CHANGE IT. At all. EVER.
Add a comment if you must, and state this is from you, not the source.
Or start your own blog, doc site, or whatever. But quoting inaccurately
is BAD.


FFS - The TITLE of the article is "BigArray<T>, getting around the 2GB array
size limit"
uhmmm... To get around a 2gb "limit" would require being LARGER than 2gb,
correct?!?
You did not even understand the TITLE of the article?!? WTF?

Arrays are not objects. They are essentially value types layed out
sequentially in memory. Objects are very different. They allow you to have
fields, properties, methods, and internal state data and other good stuff.
They certainly can be LARGER than 2gb.

Public Class Foo()
Dim a(1024*1024*2000) as byte
Dim b(1024*1024*2000) as byte
etc..

How big is this object?

First sentence of the above article: "I've received a number of
queries as to why the 64-bit version of the 2.0 .Net runtime
still has array maximum sizes limited to 2GB"

Note that this is talking about ARRAYS. Not ArrayLISTS, not OBJECTS

Further: "Differing from this are arrays of reference types
(e.g. objects, strings, class Y {}, etc.), for these arrays the actual
array will be that of a bunch of references, initially null. To initialize
the array your code will need to go through one element at a time
and create or assign an appropriate instance of the type to that array
element. The 2GB size limit for arrays applies to this array of
references, not the instances of the objects themselves"

So the size of the Instances of the ITEMS (not just the references) in the
array can be vastly LARGER THAN 2gb.

And then in the comments:
http://blogs.msdn.com/joshwil/archive/2005/08/10/450202.aspx#450213
Last sentence says "It does make one biased twoards using arrays of
primitive data types where you can instead of boxed references (e.g.
ArrayList) to avoid the significantly heavier penalties that go with that
practice on the 64-bit platform."

Which basically says for the problem at hand in this thread, the ArrayLIST,
does not suffer
from the 2gb limit. But you will burn a bunch of space on all those big
pointers.. And all the boxing
overhead, etc.


So, in summary:
1) Your information was wrong one month ago, and is still wrong.
2) Unless you read and COMPREHEND your own links, you will never understand
the issues
3) Arrays are not the same as objects and ArrayLISTs
4) This thread was about arraylists, so your response was completely OFF
TOPIC
5) Quote articles correctly.
6) Include links that support your position, not ones that have MANY things
that contradict you

Good luck with your memory issues and reading comprehension..

Have I been trolled?!?
 
there is currently a 2GB limit for all CLR objects, no matter what OS
the sentence you have such a big problem with comes from this page
http://msdn2.microsoft.com/en-us/library/ms241064(VS.80).aspx

So i guess you should ask MS to change the documentation if this is wrong

And if we are talking about Trolls well i guess you would make a good
candidate as you also did the last time we encountered

FYI

in both postings i made ( with the authorative links ) the only 2 sentences
that were mine were these 2

Please not the following even on a 64 bit system the object limit is 2 GB
however if the system has enough ram you can alocate multiple objects of 2gb

On a 32 bit system you cannot allocate full 2 gb so there sure is an
advantage to have a 64 bit system and to compile in 64 bit modus



regards

Michel Posseth
 
Back
Top