[Mono-devel-list] GC leaking memory

Jörg Rosenkranz joergr at voelcker.com
Fri Mar 19 10:03:44 EST 2004


Hi all,
 
We have a problem with the GC not releasing objects under Mono.
We are monitoring the memory of managed objects using 
GC.GetTotalMemory(false). The returned number is increasing over
time and never goes down to an normal level. Running the same 
application under windows doing the same jobs the managed memory
stays at about 20MB. Under Mono it's increasing to 250MB and more
until the app isn't responding anymore. I exclude a program fault in 
our application (objects staying alive because of living references).
 
I've profiled the application and got following top memory numbers:
 
Allocation profiler
Total mem Method
########################
   61914 KB System.Text.RegularExpressions.Interpreter::Eval(Interpreter/Mode,int&,int)
       61914 KB  1761123 .RepeatContext                                  
  Callers (with count) that contribute at least for 1%:
    16623678  85 % System.Text.RegularExpressions.Interpreter::Eval(Interpreter/Mode,int&,int)
     2867005  14 % System.Text.RegularExpressions.Interpreter::TryMatch(int&,int)
########################
   48297 KB System.String::Copy(string)
       48297 KB  1300144 System.String                                   
  Callers (with count) that contribute at least for 1%:
     1166449  89 % System.Data.OracleClient.Oci.OciHandle::GetAttributeString(OciAttributeType,OciErrorHandle)
      133695  10 % System.Data.OracleClient.Oci.OciDefineHandle::GetValue()
########################
   46303 KB System.Text.StringBuilder::InternalEnsureCapacity(int)
       46303 KB   148926 System.String                                   
  Callers (with count) that contribute at least for 1%:
      100521  67 % System.Text.StringBuilder::Append(string)
       44028  29 % System.Text.StringBuilder::Append(char)
        4373   2 % System.Text.StringBuilder::Append(string,int,int)
########################
   46195 KB System.Data.OracleClient.Oci.OciHandle::GetAttributeString(OciAttributeType,OciErrorHandle)
       46195 KB  1166450 System.String                                   
  Callers (with count) that contribute at least for 1%:
     1166449  100 % System.Data.OracleClient.Oci.OciParameterDescriptor::GetName()
########################
   42309 KB System.Data.OracleClient.Oci.OciStatementHandle::GetParameter(int)
       42309 KB  1203458 System.Data.OracleClient.Oci.OciParameterDescriptor
  Callers (with count) that contribute at least for 1%:
     1164689  96 % System.Data.OracleClient.OracleDataReader::GetOrdinal(string)
       37889   3 % System.Data.OracleClient.Oci.OciDefineHandle::DefineByPosition(int)
########################

 
Are there any known problems preventing the GC from releasing 
memory under pressure? Are there any problems releasing strings?
Is there any possibility to find out which objects aren't collected?
 
 
Any help is highly appreciated because this is a major problem for us.
 
Thanks,
Joerg.


More information about the Mono-devel-list mailing list