none
Garbage Collection on Citrix RRS feed

  • Question

  • We are running a client app on a citrix farm - which to make things more fun i believe is a virtual machine.
    This is a vb6 app which loads x amount of .net forms via the interop toolkit.
    This is all fine as the .net forms previously were all config forms and used infrequently, now however we have a form that is used a lot.
    From watching the mem usage in taskmgr we can see each instance takes another 5mgs or so, to confirm this is not just a mem leak we kept opening the form and eventually the GC kicked in and reduced most of the mem to a figure closer enough to what we started with.
    It seems though that we have to get to 32MG free before the GC kicks in, this is causing major problems for all the machine monitoring apps.

    Currently i havent found anything (machine.config, app.config) that suggests we can limit the amount of mem before the GC kicks in and it seems bad to invoke the GC when the app gets to a certain mem usage.
    I will keep investigating (as i have only spent a couple of hours) but figured somebody must of come across this issue at some point already.

    Cheers

    Thursday, October 1, 2009 12:25 AM

Answers

  • You cannot tweak this.  Citrix and the CLR are a gross mismatch, the CLR assumes 2GB of virtual memory readily available.  Sell your stock as soon as you can.

    Hans Passant.
    • Marked as answer by Bort Verdon Thursday, October 1, 2009 1:18 AM
    Thursday, October 1, 2009 12:43 AM
    Moderator
  • The runtime host assumes nGB of virtual memory, but like nobugz said - it can't be tweaked.

    However, it can be custom built.  Only then will the elusive secrets and tao of managed memory reveal themselves to you...  After all, the CLR runs adequately in the mobile environments.  :)

    Good article talking about just this:
    http://msdn.microsoft.com/en-us/magazine/cc301479.aspx



    Just a side note - To me, the initial thought of creating a custom runtime host for your issue seemed like absurd over-kill.  But the more I thought about it, having a seperate runtime host for thin-client, VMs and Citrix type of environments started to sound a lot better.  You administer the images, so rolling it out and adjusting it to image size won't be a problem.  Plus I would think (in some cases) having that degree of control in your client's managed process execution would pull on the same heart strings that motivated the decision to use this structure in the first place?

    Don't know, but I deffinitely wouldn't dismiss the idea right away.

    • Marked as answer by eryang Wednesday, October 14, 2009 2:29 AM
    Thursday, October 1, 2009 1:40 AM

All replies

  • You cannot tweak this.  Citrix and the CLR are a gross mismatch, the CLR assumes 2GB of virtual memory readily available.  Sell your stock as soon as you can.

    Hans Passant.
    • Marked as answer by Bort Verdon Thursday, October 1, 2009 1:18 AM
    Thursday, October 1, 2009 12:43 AM
    Moderator
  • I have no idea if it will help (Hans it quite possibly right), but there is a setting you can put in a .config file for a .net application to change the way the GC behaves (server vs workstation)... you might find you get a better result using the other mode, or you might find it's worse or does nothing. Thing is, I'm not entirely sure how you'd apply the setting to a VB6 app.
    Thursday, October 1, 2009 1:05 AM
  • Thanks Hans - that is sadly what i am starting to think myself.
    Thanks Yort - We have looked into that as it seems to be the only GC option available - it didnt actually do anything in our case.
    Thursday, October 1, 2009 1:18 AM
  • The runtime host assumes nGB of virtual memory, but like nobugz said - it can't be tweaked.

    However, it can be custom built.  Only then will the elusive secrets and tao of managed memory reveal themselves to you...  After all, the CLR runs adequately in the mobile environments.  :)

    Good article talking about just this:
    http://msdn.microsoft.com/en-us/magazine/cc301479.aspx



    Just a side note - To me, the initial thought of creating a custom runtime host for your issue seemed like absurd over-kill.  But the more I thought about it, having a seperate runtime host for thin-client, VMs and Citrix type of environments started to sound a lot better.  You administer the images, so rolling it out and adjusting it to image size won't be a problem.  Plus I would think (in some cases) having that degree of control in your client's managed process execution would pull on the same heart strings that motivated the decision to use this structure in the first place?

    Don't know, but I deffinitely wouldn't dismiss the idea right away.

    • Marked as answer by eryang Wednesday, October 14, 2009 2:29 AM
    Thursday, October 1, 2009 1:40 AM