Insufficient Memory Error in wisej web app

0
0

We have an large wisej web application in production. We have 2 servers (app and db) servers with Intel(R) Xeon(R) E-2224 CPU @ 3.40GHz, 3408 Mhz with 4 cores and 32 GB memory. We have about 100 users.  The system works mainly with panels (user controls) and Windows to search users, accounts, licences, get parameters from user, displaying pdf reports, etc. The system works fine but after a few hours of operation send a error message “Insufficient memory”. After investigation and reading similar messages in this forum i realize then we have 2 problems:

  1. Inadecuate values from SharedSection in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems. What values you recommend for heap size?
  2. Inaddeacuate release of windows. Generaly we use an “using (window x = new window) {} pattern” but maybe we have other code in certain modules. What you recommend to effectively releasing the resources of windows.

Sincerely. I appreciate your kindly answer. Sorry for my english.

Ing. Edmundo Ríos Miranda.

 

  • You must to post comments
0
0

Best would be to have a code review by Wisej guys.

Out-of-memory situations are not strictly Wisej problem, but they can point you to memory leaks and help improving session handling.

 

What you can do yourself:

  1. Make sure you are using 64 bits, not 32 bits.
  2. The Visual Studio 2022 has nice Diagnostic Tools to list up all memory objects by count and size.

During debugging, you can: (1) take a memory snapshot, (2) open a window, (3) do some operations, (4) close the window, (5) take another memory snapshot.

The Diagnostic Tools will show you all object created between the snapshots.

 

3. If really critical (like you are losing reputation and need a quick fix), you can (temporarily) force-run a garbage collection, until you resolve the issue.

Do not run GC as a permanent fix.

 

This should be called after a client disposes a window.

This will freeze all clients for ~1 second.

 

System.Runtime.GCSettings.LargeObjectHeapCompactionMode = Runtime.GCLargeObjectHeapCompactionMode.CompactOnce
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, True, True)
System.Threading.Thread.Sleep(100)
GC.WaitForPendingFinalizers()
System.Threading.Thread.Sleep(100)
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, True, True) ‘ collect dead objects
System.Threading.Thread.Sleep(100)

 

4. In your web.config, set something like

<configuration>
<runtime>
<gcServer enabled=”true” />
<gcConcurrent enabled=”true” />
<gcAllowVeryLargeObjects enabled=”true” />
<GCLOHThreshold enabled=”4194304″ />
</runtime>
</configuration>

5. Even you have 32 GB RAM, increase your paging file to be fixed-size 16 GB.

 

But better ask Wisej team for special support.

 

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.