Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Windows Service Rant

Windows Service Rant

Scheduled Pinned Locked Moved The Lounge
csharpcomtoolsperformancequestion
21 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Ennis Ray Lynch Jr

    Actually this is probably a .NET rant. My newly developed service was slowly but surely using more and more memory. Surely, it couldn't be a memory leak because only managed objects where used! Turns out every time a local variable is declared (even a base value type) the memory usage would go up (o.k., that is expected) but what I really didn't expect was for the memory to stay used when the value objects went out of scope! eh, what can you do? Sure the memory will be freed when garbage collection runs but it is embarrassing to see my service slowly take up more and more memory! Looks like I may have a use, after all, for my object pool code.

    Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

    realJSOPR Offline
    realJSOPR Offline
    realJSOP
    wrote on last edited by
    #21

    I had a thought - if the objects are too big, they get put on a different heap - one that isn't affected by the garbage collector. Someone else pointed out that you said "local" variable. It might be that the GC won't delete them because it sees them as still in use, so you might want to look into making it global (and maybe static) to the service itself, yet outside the service1 class itself. Maybe also make it disposable.

    .45 ACP - because shooting twice is just silly
    -----
    "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
    -----
    "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups