hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: closing hbase resources for webapp
Date Tue, 04 Mar 2014 01:55:05 GMT
bq. Tomcat detects that I may have a memory leak

Can you show us the warning from Tomcat.

w.r.t. the snippet you posted: the two close() calls should be enclosed in
finally block.


On Mon, Mar 3, 2014 at 1:21 PM, Toby Lazar <tlazar@capitaltg.com> wrote:

> I am working on an HBase webapp and Tomcat is telling me I have a memory
> leak, which I have confirmed, but I'm not sure how to fix it.  I've reduced
> my app to a single jsp that calls a single method (both are included below
> since they are short).  After I reload my application, Tomcat detects that
> I may have a memory leak, leading me to think I should be doing something
> else when closing an HConnection.  I tried the deprecated
> HConnectionManager.deleteConnection(config) without any luck.
>
> I am using Hadoop 2.2/HBase 0.96 client jars and running it on Tomcat
> 7.0.47/JVM 1.7.0_45 on CentOS 6.5.
>
> Any ideas what I'm missing or how to work around this?
>
> Thanks!
>
> Toby
>
>
>
> JSP is:
>
> <%@page import="foobar.Test"%>
> <%@ page language="java" contentType="text/html; charset=UTF-8"
>     pageEncoding="UTF-8"%>
> <%out.println(Test.hello()); %>
>
> Java method in the Test class is:
>
> public static String hello() throws IOException{
>  Configuration config = HBaseConfiguration.create();
> HConnection connection = HConnectionManager.createConnection(config);
> HTableInterface table = connection.getTable("sometable");
> table.close();
> connection.close();
> return "hellosay";
>  }
>
>
>
> *******************************
>   Toby Lazar
>   Capital Technology Group
>   Email: tlazar@capitaltg.com
>   Mobile: 646-469-5865
> *******************************
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message