[ https://issues.apache.org/jira/browse/HIVE-23633?focusedWorklogId=444162&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-444162 ] ASF GitHub Bot logged work on HIVE-23633: ----------------------------------------- Author: ASF GitHub Bot Created on: 11/Jun/20 07:43 Start Date: 11/Jun/20 07:43 Worklog Time Spent: 10m Work Description: kgyrtkirk commented on a change in pull request #1071: URL: https://github.com/apache/hive/pull/1071#discussion_r438601029 ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java ########## @@ -13272,19 +13283,18 @@ public int deleteScheduledExecutions(int maxRetainSecs) { return 0; } boolean committed = false; + Query q = null; try { openTransaction(); int maxCreateTime = (int) (System.currentTimeMillis() / 1000) - maxRetainSecs; - Query q = pm.newQuery(MScheduledExecution.class); + q = pm.newQuery(MScheduledExecution.class); Review comment: The `Query` and `QueryWrapper` classes are `AutoCloseable` - which might be better than closing it by hand (`Query#close` calls `closeAll` so it does the same) so I think it would be better to use try-with-resources to close these objects...at least in cases when there is already a `try` there... ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 444162) Time Spent: 40m (was: 0.5h) > Metastore some JDO query objects do not close properly > ------------------------------------------------------ > > Key: HIVE-23633 > URL: https://issues.apache.org/jira/browse/HIVE-23633 > Project: Hive > Issue Type: Bug > Reporter: Zhihua Deng > Priority: Major > Labels: pull-request-available > Time Spent: 40m > Remaining Estimate: 0h > > After patched [HIVE-10895|https://issues.apache.org/jira/browse/HIVE-10895], The metastore still has seen a memory leak on db resources: many StatementImpls left unclosed. -- This message was sent by Atlassian Jira (v8.3.4#803005)