system out of memory exception having 50% of the ram used

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

system out of memory exception having 50% of the ram used

Postby batmaci » Fri Jul 13, 2012 12:18 pm

Hi,

I am caching some of my tables into memory using shared class like show below or as entity POCO object. I tried both of them.
Code: Select all
 Public Shared Function CacheDT() As cacheDS.CacheDataTable
        If _CacheDT Is Nothing Then
            Dim myCacheTableAdapter As New cacheDSTableAdapters.CacheTableAdapter
            _CacheDT = myCacheTableAdapter.GetData()
        End If
        Return _CacheDT
    End Function



there are plenty of tables which arent changed frequently in my DB. that's why i am caching about 2 GB of data in the memory. my developer machine has 16 gb ram and webserver has 64 gb ram. I am getting system out of memory exception altougt physical memory usage isnt even reaching 8 gb. I found that nice article explaining me it is nothing to do with physical memory but addressing fact http://blogs.msdn.com/b/ericlippert/arc ... emory.aspx

Indeed in the article he says it shouldnt be a problem with 64bit machine but my both machines are 64. how does it occur? how can I manage my memory by setting up something or coding something in VB or C#?

I would like to profile my application using ants profiler, I need your advise as I am newbie on that.

thanks for suggestion.
batmaci
 
Posts: 2
Joined: Fri Jul 13, 2012 12:15 pm

Postby Brian Donahue » Mon Jul 16, 2012 10:44 am

If the process you are profiling is 32-bit (compiled as "x86"), then Windows has a process memory limit of 2GB. .NET Framework starts to get unstable at about 1.5GB, typically, and throws an outofmemoryexception.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Re:

Postby batmaci » Mon Jul 16, 2012 10:48 am

Brian Donahue wrote:If the process you are profiling is 32-bit (compiled as "x86"), then Windows has a process memory limit of 2GB. .NET Framework starts to get unstable at about 1.5GB, typically, and throws an outofmemoryexception.


hi Brian,

thanks for your reply but I checked all projects and they are running as "any CPU". my developer machine and server are both 64. that means I believe i am not running 32. Am I correct? thanks
batmaci
 
Posts: 2
Joined: Fri Jul 13, 2012 12:15 pm

Postby Brian Donahue » Mon Jul 16, 2012 11:48 am

Maybe/maybe not. You can get anycpu to run as 32-bit if you put the program in the (x86) profram files folder. If you view the process in Task Manager, has it got a *32 next to the process name?
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby dene.boulton » Mon Jul 16, 2012 2:24 pm

Also if the application is a WebApp deployed to IIS, and the application pool that the app runs in has the "Enable 32-bit application" setting set to "True". If this is the case then the worker process, like Brian says, will be w3wp.exe *32
Dene Boulton
Red Gate
dene.boulton
 
Posts: 53
Joined: Wed Oct 12, 2011 12:44 pm
Location: Cambridge


Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 0 guests