Re: Pressuring GC to give up clean up memory.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Frank Rizzo" <none@xxxxxxxx> wrote in message news:eY8eK0llHHA.208@xxxxxxxxxxxxxxxxxxxxxxx
Nicholas Paldino [.NET/C# MVP] wrote:
Frank,

Is the number you are seeing the only concern, or is the memory that is being consumed by your app having a measurable effect on other applications on the box?

Basically, the powers that be, decided that the app is going to be on the same box as the SqlServer2k5 64-bit, which consumes ungodly amounts of memory (compared to sqlserver2k, anyways). So the sum of my app and SQL Server is pushing up against the limits of physical memory. When it does cross that limit, things get really, really slow. When my app is idle for more than a certain amount of time, I try to dump the memory contents by setting the root object to null - but that does not seem to be having an effect.




If SQL Server is configured to consume exactly what it needs, and there is enough memory left to let your application run without the risk of excessive paging you are set, else you are in a world of pain, playing ticks with the GC won't help. Just face it, when there is memory pressure (that is, you have reached a certain threshold) because SQL needs more memory, the OS will ask your application (and others) to reduce it's working set, the CLR will trigger a full collection and the CLR's memory manager will return freed heap space (if any) to the OS, if the GC cannot release enough memory, the OS will simply trim your application's (and others) working set, by writing modified pages to the page file, until there is enough free memory to fulfill SQL's request. Whenever your application get's a chance to run again, it will "possibly" need to page-in the pages previously written to the page file, but to make this happen, the OS will need to trim the WS of SQL server, this is especially bad from a performance perspective, so your only options are:
- Reduce the memory consumption of your application, inspect your object hierarchies, are you using the most optimal container types, are you taking care of the growth algorithms of some of these containers, aren't you overusing OO paradigms?
- If your application runs as 64 bit application, recompile it as 32 bit (unless you need to address more than 2GB), 64 BIT applications are real memory hogs, especially managed applications.
- Add more memory to the box.

Willy.

.



Relevant Pages

  • Re: Processing queries simultaneously
    ... >>The 1.5 will limit the memory pool in SQL Server to 1.5GB and sql server ... >>uses>another few hundred MB's for things other than the memory pool. ... When the VB app that retrieves the data returns 500,000K ... >> same machine that all need to use cpu at the same time. ...
    (microsoft.public.sqlserver.programming)
  • Re: Processing queries simultaneously
    ... > uses about 50 meg of memory, but after it's done sending to the client, it ... memory for SQL Server to always allow memory for the VB Apps since they are ... >> Having another app such as this on the same server is never good for>> performance since they will both compete for resources, especially memory>> and cpu. ...
    (microsoft.public.sqlserver.programming)
  • Re: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... Of course, if you use 8GB of RAM, or more precisely if you ... Are you saying that if I have a 4GB RAM memory, ... Linux will somehow "know" that it doesn't have ... You've said in another message that your app is ...
    (comp.os.linux.setup)
  • Re: How to set up a Linux machine that occupies the minimum memory footprint ?
    ... Of course, if you use 8GB of RAM, or more precisely if you ... Are you saying that if I have a 4GB RAM memory, ... Linux will somehow "know" that it doesn't have ... You've said in another message that your app is ...
    (comp.os.linux.misc)
  • Disk thrashing with paging file
    ... of disk thrashing while memory is paged back in. ... that neither our apps or SQL Server is doing anything at the time to trigger ... user interface app holds lots of data in memory. ... VB6 COM DLLs.) ...
    (microsoft.public.vb.winapi)