You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Tom Brown <to...@gmail.com> on 2012/09/21 18:02:52 UTC

Usage of the task monitor

Hi all,

I was having some odd server pauses that appeared to be related to my
usage of a coprocessor endpoint. To help me monitor these, I attempted
to use the task monitor; Now I've got a memory leak and I suspect it's
because I'm not correctly marking each monitored task as completed
(YourKit shows that the majority of the memory is taken up by char[]s
that contain the statuses of my tasks).

I was unable to find good documentation about monitored tasks, so I
inferred that calling either "markComplete" or "abort" on each task
would be sufficient. Can anybody tell me the right way to clean up
these items?  Is there a right way?

Thanks in advance!

--Tom

Re: Usage of the task monitor

Posted by Tom Brown <to...@gmail.com>.
The monitored tasks are not being explicitly stored anywhere, but they
are sometimes passed between threads via closures. Could that be
causing references to stick around longer than they should?

Here is an example of how I'm using the monitored tasks:

final MonitoredTask task = monitor.createStatus("Updating");
worker.process(new ItemToProcess() {
     @Override
     public void process() {
          doWork(task);
     }
});

Even if the above is creating extra references, the task monitor
appears to have logic that is supposed to account for leaked tasks--
it uses a proxy object and weak references to attempt to detect when
it has been leaked-- but that mechanism does not appear to be working
in this case.

--Tom

On Fri, Sep 21, 2012 at 11:45 PM, Stack <st...@duboce.net> wrote:
> On Fri, Sep 21, 2012 at 9:02 AM, Tom Brown <to...@gmail.com> wrote:
>> Hi all,
>>
>> I was having some odd server pauses that appeared to be related to my
>> usage of a coprocessor endpoint. To help me monitor these, I attempted
>> to use the task monitor; Now I've got a memory leak and I suspect it's
>> because I'm not correctly marking each monitored task as completed
>> (YourKit shows that the majority of the memory is taken up by char[]s
>> that contain the statuses of my tasks).
>>
>> I was unable to find good documentation about monitored tasks, so I
>> inferred that calling either "markComplete" or "abort" on each task
>> would be sufficient. Can anybody tell me the right way to clean up
>> these items?  Is there a right way?
>>
>
> You checked how other monitored tasks are done in the task monitor?
> markComplete seems right.  Anything else referencing these tasks other
> than task monitor?
>
> St.Ack

Re: Usage of the task monitor

Posted by Stack <st...@duboce.net>.
On Fri, Sep 21, 2012 at 9:02 AM, Tom Brown <to...@gmail.com> wrote:
> Hi all,
>
> I was having some odd server pauses that appeared to be related to my
> usage of a coprocessor endpoint. To help me monitor these, I attempted
> to use the task monitor; Now I've got a memory leak and I suspect it's
> because I'm not correctly marking each monitored task as completed
> (YourKit shows that the majority of the memory is taken up by char[]s
> that contain the statuses of my tasks).
>
> I was unable to find good documentation about monitored tasks, so I
> inferred that calling either "markComplete" or "abort" on each task
> would be sufficient. Can anybody tell me the right way to clean up
> these items?  Is there a right way?
>

You checked how other monitored tasks are done in the task monitor?
markComplete seems right.  Anything else referencing these tasks other
than task monitor?

St.Ack