Tapestry has been noted to be effectively free of memory leaks.

What release of Tapestry are you using?

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?

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.

You can use VisualVM to get an idea of what objects are in memory,
that might help identify what, if anything, is leaking.

On Wed, Jun 6, 2012 at 12:19 PM, George Christman
<gchrist...@cardaddy.com> 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: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
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: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to