Auto fetch, serializing on shutdown

21 views
Skip to first unread message

Daryl Stultz

unread,
May 8, 2012, 12:26:23 PM5/8/12
to eb...@googlegroups.com
Hello,

I have set ebean.autofetch.useFileLogging to false. In DefaultAutoFetchManager I see this (2.7.4):

public void shutdown() {
 collectUsageViaGC(-1);
 if (useFileLogging) {
     serialize();
 }
}

useFileLogging is false, so no serialization is done, but collectUsageViaGC is still called even though we aren't going to serialize the data. Why is this done?

I introduced Ebean into my project a couple of months ago. I have almost 30 applications on tomcat deployed using Ebean. I've noticed it takes longer than it used to to shutdown tomcat. I've introduced other technologies as well, so can't say for sure that the cause is Ebean. I'm wondering if the call to System.gc() is contributing to the slow shutdown.

Should collectUsageViaGC be skipped if useFileLogging is false?

Thanks.

/Daryl

Rob Bygrave

unread,
May 8, 2012, 5:30:14 PM5/8/12
to eb...@googlegroups.com
>> Should collectUsageViaGC be skipped if useFileLogging is false?

Yes, I think it should.

Cheers, Rob.

Daryl Stultz

unread,
May 15, 2012, 8:11:10 AM5/15/12
to eb...@googlegroups.com
On Tue, May 8, 2012 at 5:30 PM, Rob Bygrave <robin....@gmail.com> wrote:
>> Should collectUsageViaGC be skipped if useFileLogging is false?

Yes, I think it should.

I've modified it like so:

public void shutdown() {
  if (useFileLogging) {
    collectUsageViaGC(-1);
    serialize();
  }

It seems to work fine when useFileLogging is true and my application shuts down much faster when it is false.

/Daryl

Rob Bygrave

unread,
May 27, 2012, 7:08:44 AM5/27/12
to eb...@googlegroups.com
FYI

Logged as Bug-400.  Fixed in HEAD.

Daryl Stultz

unread,
May 27, 2012, 11:20:33 AM5/27/12
to eb...@googlegroups.com
On Sun, May 27, 2012 at 7:08 AM, Rob Bygrave <robin....@gmail.com> wrote:
FYI

Logged as Bug-400.  Fixed in HEAD.

Thanks, Rob.

/Daryl

Reply all
Reply to author
Forward
0 new messages