ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Hanson" <mnbo...@gmail.com>
Subject Re: memory leak with windows service?
Date Thu, 06 Sep 2007 16:13:00 GMT
Re #1: Believe me, I've been doing this long enough to know that anytime I
want to blame something else, I know it's probably my error. I found a post
http://www.thescripts.com/forum/thread213771.html that mentions a similar

Re #2: See previous. :)

Re #3: I don't think I have this issue. iBatis is used to return POCO.

I use spring with the singleton="false" attribute for many of my objects.
Not sure why that would make any difference but I'll mention it just in

On 9/6/07, Dustin Aleksiuk <Dustin.Aleksiuk@huskyenergy.ca> wrote:
>  Hi Bob,
> It's hard to say without looking at your code, but here are some opinions
> of mine:
> 1. The GC is extremely intelligent. A memory leak in managed code will be
> because you still have a reference somewhere to memory, which the GC can't
> touch. I believe that 99 times out of 100 you're making a mistake by forcing
> the GC to clean up.
> 2. I bet it's not iBatis, Log4net or spring. Many people (including me)
> use these every day with no issues.
> 3. Make sure you have no static fields or similar things that could be
> keeping a hold on memory.
> Regards,
> Dustin
> >>> "Bob Hanson" <mnbob70@gmail.com> 9/6/2007 9:26 AM >>>
> I don't know if this is even the proper place for me to ask these
> questions but I'm hoping others may have had a similar experience and can
> provide some advice.
> I have a Windows Service that runs on a Windows 2000 server. It uses a
> system timer that triggers a process to run every 30 minutes.
> The process is straight forward, performing 4 separate queries with each
> returning a list of objects. Those objects are then used to perform some
> functionality which involves accessing remote web services. A majority of
> the time only 2 of the 4 queries returns any data. iBatis.Net is used for
> all database interaction. Log4Net is used for logging. Spring.Net is used
> during the object processing.
> The problem I am having is that over time the Windows Service is not
> releasing memory and eventually the service will throw an out of memory
> exception and crash. The process is 100% managed code. How long it takes to
> run out of memory seems to vary but it generally takes more than 24 hours if
> not longer.
> I already modified the process to return a list of Ids instead of a list
> of complete objects. A list of only 100 ids would be a large list so I'm not
> dealing with a lot of data. I then query for a full object on an individual
> basis using the object id.
> I also call the garbage collector directly to try to force memory release.
> At this point I don't know what to do as the problem still remains. So I'm
> wondering if anyone has seen this kind of memory problem before when using a
> Windows Service with .NET. Also does anyone know if I should focus on
> iBatis, Spring or Log4Net as the possible cause? I've read about using a
> .net profiler tool but I have to admit that I have a hard time understanding
> how to profile code.
> Thanks,
> Bob

View raw message