Enabling "Accurate Object Age" makes my app behave differently

3 posts, 0 answers
  1. Rob
    Rob avatar
    2 posts
    Member since:
    Jul 2014

    Posted 23 Jul 2014 Link to this post

    I want to investigate memory usage after my app reaches a certain checkpoint. In particular, I want to see any memory allocations made *after* this checkpoint that make it to Gen2. I'm trialling JustTrace, as the "Instances Diff" with "Accurate Object Age" seems ideal for this.

    However, my app behaves differently when profiled with "Accurate Object Age" is enabled. My app diverts to an error handling branch and thus never reaches the checkpoint.
    (My app performs various deterministic calculations, the only user interaction is a Console.ReadLine() where I want to take the snapshots. Thus there should be no variation in behaviour between runs)

    If I run the app alone, or run it via the JustTrace memory profiler either with or without "Collect allocation call stacks" enabled, then it works exactly as expected. But the "Accurate Object Age" feature appears to break things.

  2. Rob
    Rob avatar
    2 posts
    Member since:
    Jul 2014

    Posted 23 Jul 2014 in reply to Rob Link to this post

    Oops - this is my fault. On further investigation, the reason for the change in behaviour is an "Out of Memory" exception was thrown. It's not surprising that collecting ages increases the memory used. Will find a workaround and retry the feature
  3. DevCraft R3 2016 release webinar banner
  4. Tsvetomir
    Tsvetomir avatar
    15 posts

    Posted 24 Jul 2014 Link to this post

    Hello Rob,

    I am glad that you found the cause of this unpleasant behavior.

    Indeed, enabling "Accurate Object Age" option gives more detailed of view of object's lifespan, but significantly  increases the memory consumption and gives some performance drawback. I would suggest (if it is an option) to profile your application on more powerful PC with 64 bit OS.

    Kind Regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top