Return-Path: Delivered-To: apmail-incubator-pig-dev-archive@locus.apache.org Received: (qmail 12356 invoked from network); 10 Jan 2008 21:27:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2008 21:27:02 -0000 Received: (qmail 7566 invoked by uid 500); 10 Jan 2008 21:26:49 -0000 Delivered-To: apmail-incubator-pig-dev-archive@incubator.apache.org Received: (qmail 7535 invoked by uid 500); 10 Jan 2008 21:26:49 -0000 Mailing-List: contact pig-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pig-dev@incubator.apache.org Delivered-To: mailing list pig-dev@incubator.apache.org Received: (qmail 7483 invoked by uid 99); 10 Jan 2008 21:26:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2008 13:26:49 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2008 21:26:45 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 30E9771425E for ; Thu, 10 Jan 2008 13:26:37 -0800 (PST) Message-ID: <7706068.1200000397197.JavaMail.jira@brutus> Date: Thu, 10 Jan 2008 13:26:37 -0800 (PST) From: "Sam Pullara (JIRA)" To: pig-dev@incubator.apache.org Subject: [jira] Commented: (PIG-40) Memory management in BigDataBag is probably wrong In-Reply-To: <4009847.1196381503814.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/PIG-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557805#action_12557805 ] Sam Pullara commented on PIG-40: -------------------------------- Looked through the solution to this... looks great! > Memory management in BigDataBag is probably wrong > ------------------------------------------------- > > Key: PIG-40 > URL: https://issues.apache.org/jira/browse/PIG-40 > Project: Pig > Issue Type: Bug > Components: impl > Reporter: Sam Pullara > Assignee: Benjamin Reed > Attachments: BigDataBag.java, MemoryUsage.java > > > src/org/apache/pig/data/BigDataBag.java > 1) You should not use finalizers for things other than external resources -- using them here is very dangerous and could inadvertantly lead to deadlocks and object resurrection and just decreases performance without any advantage. > 2) Using .freeMemory() the way it is used in this class is broken. freeMemory() is going to return a mostly random number between 0 and the real amount. Adding gc() in here is a terrible performance burden. If you really want to do something like this you should using softreferences and finalization queues. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.