[Mono-list] OutOfMemoryException

Yury Serdyuk Yury@serdyuk.botik.ru
Fri, 18 Mar 2005 15:29:38 +0300


This is a multi-part message in MIME format.
--------------000209080300000406020905
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi !

I've encountered problem trying allocate array of  > 1 Gb size on 
machine with 4 Gb RAM :

        total:    used:    free:  shared: buffers:  cached:
Mem:  4234272768 2322898944 1911373824        0 128507904 1867874304
Swap: 2097434624        0 2097434624
MemTotal:      4135032 kB
MemFree:       1866576 kB
MemShared:           0 kB
Buffers:        125496 kB
Cached:        1824096 kB
SwapCached:          0 kB
Active:         506704 kB
Inactive:      1471372 kB
HighTotal:     3276224 kB
HighFree:      1613452 kB
LowTotal:       858808 kB
LowFree:        253124 kB
SwapTotal:     2048276 kB
SwapFree:      2048276 kB
meminfo (END)

[serdyuk@itk-104 StreamRLI]$ uname -a
Linux server 2.4.25bigmem #7 SMP Wed Dec 15 10:05:05 EET 2004 i686 i686 
i386 GNU/Linux

[serdyuk@itk-104 StreamRLI]$ mono Test1GbMemory.exe 400
Array size = 512000000
Allocated bytes = 512098304
[serdyuk@itk-104 StreamRLI]$ mono Test1GbMemory.exe 500

Unhandled Exception: System.OutOfMemoryException: Out of memory
in (unmanaged) 0x8080be0
in <0x00004> (wrapper managed-to-native) 
System.Object:__icall_wrapper_ves_array_new_va_3 
(intptr,intptr,intptr,intptr)
in <0x00037> Test1GbMemory:Main (string[])

[serdyuk@itk-104 StreamRLI]$

[serdyuk@itk-104 StreamRLI]$ mono -V
Mono JIT compiler version 1.1.4, (C) 2002-2004 Novell, Inc and 
Contributors. www.go-mono.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : normal
        Globalization: none
[serdyuk@itk-104 StreamRLI]$

> using System;
>
> public class Test1GbMemory {
>
>  public static void Main ( String[] args ) {
>
>   int N = System.Convert.ToInt32 ( args [ 0 ] );
>
>   double[,,] array = new double [ N, N, N ];
>
>   Console.WriteLine ( "Array size = " + ( N * N * N * 8 ) + "\n" +
>                       "Allocated bytes = " + GC.GetTotalMemory  ( 
> false ) );
>   return;
>
>  }
>
> }

Is it a bug  or
there are some special tools to work  on  big memory  ?

Thanks.

Yury.

--------------000209080300000406020905
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi !<br>
<br>
I've encountered problem trying allocate array of&nbsp; &gt; 1 Gb size on
machine with 4 Gb RAM :<br>
<br>
&nbsp;<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; total:&nbsp;&nbsp;&nbsp; used:&nbsp;&nbsp;&nbsp; free:&nbsp; shared: buffers:&nbsp; cached:<br>
Mem:&nbsp; 4234272768 2322898944 1911373824&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 128507904 1867874304<br>
Swap: 2097434624&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 2097434624<br>
MemTotal:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4135032 kB<br>
MemFree:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1866576 kB<br>
MemShared:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 kB<br>
Buffers:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 125496 kB<br>
Cached:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1824096 kB<br>
SwapCached:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 kB<br>
Active:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 506704 kB<br>
Inactive:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1471372 kB<br>
HighTotal:&nbsp;&nbsp;&nbsp;&nbsp; 3276224 kB<br>
HighFree:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1613452 kB<br>
LowTotal:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 858808 kB<br>
LowFree:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 253124 kB<br>
SwapTotal:&nbsp;&nbsp;&nbsp;&nbsp; 2048276 kB<br>
SwapFree:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2048276 kB<br>
meminfo (END)</small><br>
<br>
[<small>serdyuk@itk-104 StreamRLI]$ uname -a<br>
Linux server 2.4.25bigmem #7 SMP Wed Dec 15 10:05:05 EET 2004 i686 i686
i386 GNU/Linux<br>
<br>
[serdyuk@itk-104 StreamRLI]$ mono Test1GbMemory.exe 400<br>
Array size = 512000000<br>
Allocated bytes = 512098304<br>
[serdyuk@itk-104 StreamRLI]$ mono Test1GbMemory.exe 500<br>
<br>
Unhandled Exception: System.OutOfMemoryException: Out of memory<br>
in (unmanaged) 0x8080be0<br>
in &lt;0x00004&gt; (wrapper managed-to-native)
System.Object:__icall_wrapper_ves_array_new_va_3
(intptr,intptr,intptr,intptr)<br>
in &lt;0x00037&gt; Test1GbMemory:Main (string[])<br>
<br>
[serdyuk@itk-104 StreamRLI]$<br>
<br>
[serdyuk@itk-104 StreamRLI]$ mono -V<br>
Mono JIT compiler version 1.1.4, (C) 2002-2004 Novell, Inc and
Contributors. <a class="moz-txt-link-abbreviated" href="http://www.go-mono.com">www.go-mono.com</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TLS:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; __thread<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GC:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Included Boehm (with typed GC)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIGSEGV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : normal<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Globalization: none<br>
[serdyuk@itk-104 StreamRLI]$</small><br>
<br>
<blockquote type="cite"><small>using System;<br>
  <br>
public class Test1GbMemory {<br>
  <br>
&nbsp;public static void Main ( String[] args ) {<br>
  <br>
&nbsp; int N = System.Convert.ToInt32 ( args [ 0 ] );<br>
  <br>
&nbsp; double[,,] array = new double [ N, N, N ];<br>
  <br>
&nbsp; Console.WriteLine ( "Array size = " + ( N * N * N * 8 ) + "\n" +<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Allocated bytes = " + GC.GetTotalMemory&nbsp; ( false
) );<br>
&nbsp; return;<br>
  <br>
&nbsp;}<br>
  <br>
}</small></blockquote>
Is it a bug&nbsp; or<br>
there are some special tools to work&nbsp; on&nbsp; big memory&nbsp; ?<br>
<br>
Thanks.<br>
<br>
Yury. <br>
</body>
</html>

--------------000209080300000406020905--