Return-Path: X-Original-To: apmail-hama-dev-archive@www.apache.org Delivered-To: apmail-hama-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1944510A4F for ; Wed, 19 Jun 2013 17:56:28 +0000 (UTC) Received: (qmail 60414 invoked by uid 500); 19 Jun 2013 17:56:28 -0000 Delivered-To: apmail-hama-dev-archive@hama.apache.org Received: (qmail 58938 invoked by uid 500); 19 Jun 2013 17:56:22 -0000 Mailing-List: contact dev-help@hama.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hama.apache.org Delivered-To: mailing list dev@hama.apache.org Received: (qmail 58334 invoked by uid 99); 19 Jun 2013 17:56:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jun 2013 17:56:21 +0000 Date: Wed, 19 Jun 2013 17:56:21 +0000 (UTC) From: "MaoYuan Xian (JIRA)" To: dev@hama.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HAMA-759) When peer sends message, not matter what kinds of queue used, all messages read into memory. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HAMA-759?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] MaoYuan Xian updated HAMA-759: ------------------------------ Attachment: HAMA-759.patch =20 > When peer sends message, not matter what kinds of queue used, all message= s read into memory. > -------------------------------------------------------------------------= ------------------- > > Key: HAMA-759 > URL: https://issues.apache.org/jira/browse/HAMA-759 > Project: Hama > Issue Type: Improvement > Components: bsp core > Affects Versions: 0.6.1 > Reporter: MaoYuan Xian > Attachments: HAMA-759.patch > > > Before bsp peer sends message to network, all messages have to be read in= to memory, No matter what kinds of outgoing queue used. Which means, even w= hen user use DiskQueue to sending message, no memory saving exactly. In syn= c() method of BSPPeerImpl.java=EF=BC=8C=20 > {code} > while (it.hasNext()) { > ...=20 > BSPMessageBundle bundle =3D combineMessages(messages); > // remove this message during runtime to save a bit of memory > it.remove(); > if (combiner !=3D null) { > try { > messenger.transfer(addr, bundle); > } catch (Exception e) { > LOG.error("Error while sending messages", e); > } > {code} > In the combineMessages method, all messages are put into memory: > {code} > private final BSPMessageBundle combineMessages(Iterable messages)= { > BSPMessageBundle bundle =3D new BSPMessageBundle(); > if (combiner !=3D null) { > bundle.addMessage(combiner.combine(messages)); > } else { > for (M message : messages) { > bundle.addMessage(message); > } > } > return bundle; > } > {code} > Can we make some modifications here, implements a configurable size sendi= ng bundle, only collect parts of message instead of all before sends messag= es to network. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira