May be most of your services are singletons while this is more than needed
? Like some services actually deserve to be per-thread ? Or per session ?

I'm not even sure if that may be it, just saying.

On Wed, Jun 6, 2012 at 9:34 PM, George Christman <gchrist...@cardaddy.com>wrote:

> On Wed, Jun 6, 2012 at 3:24 PM, Howard Lewis Ship [via Tapestry] <
> ml-node+s1045711n5713671...@n5.nabble.com> wrote:
>
> > Tapestry has been noted to be effectively free of memory leaks.
> >
>
> Hi Howard, I'm pretty new to services, so I'm just not sure if I'm using
> them correctly. I've had the system go down three nights due to an out of
> memory error.
>
>
> > What release of Tapestry are you using?
> >
>
> v5.3.3
>
> >
> > You seem to have a caching service here .. do you ever clear your
> > cache?  Could the contents of your cache account for the memory usage?
> >
>
> Nothing in the cache, I've disabled all caching and just let the scheduler
> run outputting memory usage.
>
>
> >
> > Are you checking memory usage after running at least one full GC?  If
> > you aren't running out of memory, Java is happy to let it clutter up
> > the place.
> >
>
> Perhaps I don't completely understand how GC works. I'll read up on this
> some more.
>
> >
> > You can use VisualVM to get an idea of what objects are in memory,
> > that might help identify what, if anything, is leaking.
> >
>
> I'll look into that as well. Thanks Howard.
>
> >
> > On Wed, Jun 6, 2012 at 12:19 PM, George Christman
> > <[hidden email] <http://user/SendEmail.jtp?type=node&node=5713671&i=0>>
> > wrote:
> >
> > > Hello, I've created a scheduler service and noticed a memory leak. I'm
> > using
> > > the exact code below to perform the test. I read an article related to
> > class
> > > reloading causing memory leaks,
> > > http://tapestry.apache.org/class-reloading.html However, I don't
> really
> > > understand what is being implied. I'm wondering if I'm doing something
> > wrong
> > > to cause this issue. After running the app from 14:56:23.026 through
> > > 15:16:30.222 with one second memory printouts I've noticed the
> following
> > > loss.
> > >
> > > Available memory JVM (bytes) 8826784 14:56:23.026
> > > Available memory JVM (bytes) 6906536 15:16:30.222
> > >
> > > //appmodule
> > >    public static void bind(ServiceBinder binder) {
> > >        binder.bind(SchedulerService.class, SchedulerServiceImpl.class);
> > >    }
> > >
> > >    @Startup
> > >    public static void initApplication(SchedulerService scheduler) {
> > >        scheduler.init();
> > >    }
> > >
> > >
> > >    public static AutocompleteCacheService<ApplicationUser>
> > > buildUserAutocompleteCache() {
> > >        return new AutocompleteCacheServiceImpl<ApplicationUser>() {
> > >        };
> > >    }
> > >
> > >    public static AutocompleteCacheService<IfasvVendor>
> > > buildVendorAutocompleteCache() {
> > >        return new AutocompleteCacheServiceImpl<IfasvVendor>() {
> > >        };
> > >    }
> > >
> > >    public static AutocompleteCacheService<IfasvRequisitionCode>
> > > buildRequisitionAutocompleteCache() {
> > >        return new AutocompleteCacheServiceImpl<IfasvRequisitionCode>()
> {
> > >        };
> > >    }
> > >
> > >    public static AutocompleteCacheService<Evaluator>
> > > buildEvaluatorAutocompleteCache() {
> > >        return new AutocompleteCacheServiceImpl<Evaluator>() {
> > >        };
> > >    }
> > >
> > > //Impl
> > > public class SchedulerServiceImpl implements SchedulerService {
> > >
> > >    @Inject
> > >    private RemoteUserSync remoteUserSync;
> > >
> > >    @Inject
> > >    private Session session;
> > >
> > >    @Inject
> > >    private PeriodicExecutor executor;
> > >
> > >    @InjectService("userAutocompleteCache")
> > >    private AutocompleteCacheService<ApplicationUser>
> > userAutocompleteCache;
> > >
> > >    @InjectService("vendorAutocompleteCache")
> > >    private AutocompleteCacheService<IfasvVendor>
> > vendorAutocompleteCache;
> > >
> > >    @InjectService("requisitionAutocompleteCache")
> > >    private AutocompleteCacheService<IfasvRequisitionCode>
> > > requistionAutocompleteCache;
> > >
> > >    @InjectService("evaluatorAutocompleteCache")
> > >    private AutocompleteCacheService<Evaluator>
> > evaluatorAutocompleteCache;
> > >
> > >    public SchedulerServiceImpl() {
> > >    }
> > >
> > >    public void init() {
> > >        this.autocompleteCacheUpdate();
> > >    }
> > >
> > >    private void autocompleteCacheUpdate() {
> > >        this.executor.addJob(ScheduleUtils.secondlySchedule(1),
> > >            "Autocomplete Cache Updates",
> > >            new Runnable() {
> > >                public void run() {
> > >                    memoryUsage();
> > >
> > >
> > System.out.println("*******************Completed**********************");
> > >                }
> > >            });
> > >    }
> > >
> > >    public void memoryUsage() {
> > >    /* Total amount of free memory available to the JVM */
> > >    System.out.println("Available memory JVM (bytes): " +
> > >        Runtime.getRuntime().freeMemory());
> > >
> > >    }
> > >
> > > --
> > > View this message in context:
> > http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668.html
> > > Sent from the Tapestry - User mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5713671&i=1>
> > > For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5713671&i=2>
> > >
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5713671&i=3>
> > For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5713671&i=4>
> >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> > http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668p5713671.html
> >  To unsubscribe from Memory Leak, click here<
> http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5713668&code=Z2NocmlzdG1hbkBjYXJkYWRkeS5jb218NTcxMzY2OHwxNjMyOTYxMjA3
> >
> > .
> > NAML<
> http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668p5713673.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>



-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Reply via email to