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. General Programming
  3. .NET (Core and Framework)
  4. Memory Leak in EventLog from Service

Memory Leak in EventLog from Service

Scheduled Pinned Locked Moved .NET (Core and Framework)
performancehelpquestion
1 Posts 1 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.
  • R Offline
    R Offline
    rwestgraham
    wrote on last edited by
    #1

    I have a simple Windows Service. It is a timer loop, and when the timer expires it calls an external component to check if certain tasks need to be executed. I noticed it was leaking memory. The Service itself does nothing but call a function in the external component, and it creates one reference to this component at startup and keeps this single reference to the component throughout the service lifetime. At first I thought this might be a Timer problem, because it leaks memory every time the Elapse event expires. But after a lot of experimentation, I determined that the memory leak actually occurs because of a call to write an entry in an EventLog. If I remove the EventLog entry write from the Timer_Elaspe event, the memory leak goes away. I'm running Framework 1.1 on Win2K Service Pack 4. Anyone else seen this problem??

    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