On most OSs you'll be limited to 2gb of user memory. Accounting for thread
stacks and executable areas you'll typically be down to about 1gb of heap
memory assuming no fragmentation. Empirically I've found allocating over
~384mb of memory in a contiguous region is risking an out of memory
exception due to LOB heap fragmentation in C#. C# doesn't compact the large
object heap.
On Tue, Sep 29, 2009 at 9:24 PM, Mark Bolstad <
[hidden email]>wrote:
>
>
> Could you please explain how there is a 128MB limit for allocation of an
> object? I'm sure it's some internal thing, but shouldn't it have a
> theoretical limit of 4 GB on 32-bit?
>
> This implies that the following should fail:
>
> a: ARRAY [INTEGER_32]
> ...
> create a. make (1, 100000000) -- An ~400MB array
>
> Mark
>
> On Tue, Sep 29, 2009 at 7:40 PM, Emmanuel Stapf [ES] <
[hidden email]<manus%40eiffel.com>
> >wrote:
>
>
> >
> >
> > > I doubt I'll be able to do this, given that it does not seem to hit the
> > > limit when reading only a few gigabytes of text. The only time I hit
> > > this problem is when I read a lot of text (over 10 GB) and there is
> > > probably no easy way to give you 10-13 GB of text to reproduce it.
> > >
> > > I just would have though that running out of memory would trigger a
> > > full_collect.
> >
> > You are not running out of physical memory in this particular case, you
> are
> > simply
> > hitting a runtime memory limit preventing the allocation of an object
> > larger than
> > 128MB in a 32-bit system. In such cases, the run-time has not much choice
> > but to
> > raise an exception. It would be interesting if you could run the same
> > program on a
> > 64-bit system and compare the outcome.
> >
> > Regards,
> > Manu
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]