Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 24D1B200BBF for ; Mon, 14 Nov 2016 21:49:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 23616160B06; Mon, 14 Nov 2016 20:49:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 458A3160AF4 for ; Mon, 14 Nov 2016 21:49:16 +0100 (CET) Received: (qmail 26703 invoked by uid 500); 14 Nov 2016 20:49:15 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 26693 invoked by uid 99); 14 Nov 2016 20:49:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2016 20:49:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id F3DC0C0595 for ; Mon, 14 Nov 2016 20:49:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.998 X-Spam-Level: * X-Spam-Status: No, score=1.998 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id xz3XFXCizC74 for ; Mon, 14 Nov 2016 20:49:12 +0000 (UTC) Received: from mail-pg0-f44.google.com (mail-pg0-f44.google.com [74.125.83.44]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 12F5F5FCB6 for ; Mon, 14 Nov 2016 20:49:12 +0000 (UTC) Received: by mail-pg0-f44.google.com with SMTP id 3so57997916pgd.0 for ; Mon, 14 Nov 2016 12:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=ymwNlnLx2sGlJ+Q7mluIyU37xKZdxQ1RL11jGzNd9fo=; b=h0Djv9FUyDa92AhxPDNs1kF/uWzwuOP/FEnkeyISjhDStK615BhogPqzKar1l8gc6o akXuQsGLUH34aF+kqw/chZNTRCofELIMey2VZ+fowDVe1rB3FTcn98bjA4h45Q0yBR8L iMYXl+NVAqMt/zkXFsjvtdaxFRj3BwPHo/3fCmmJo4AHQmlF4zPbY4z3ixJ3OqjYoWxO g06w2ChakPBgKvvH0egPk8GauW88WYA/dFytb3jabULoEfOKnM5J3tifcriMaCkAw+6T NgBesUCaa+c5hH1ETHfvyQuh1woSWMgLa3uQjkofMR7Ou3mWB01gusII5HYYhKnPfh/1 /GfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=ymwNlnLx2sGlJ+Q7mluIyU37xKZdxQ1RL11jGzNd9fo=; b=E9qEvKRsA+TPtqC02F8Q3TQ3dFss3YvUB3XNo4nxw3YWr4qIwFtTpmrgFL9h/z+Umw bHFHdL4NWnNi+19hVntCr+2P2eenUSMU5EpUoc3muJwS7vxy9zgWAMrcXwDdPl7gBqcQ T3obyrpHV5+VySPIfV+oHWz8Y88RMIE9qykeZGUQmMiCAmva7+E9IQ8v7hrpMDalJFzO XankiLVSlSBzoXLIS1huZL+0KNShZ0ASJk4LgiyIyLoCT5+cT5/B6czaaVdaHzebeZ/A +OwOZ6I5Us7hHtg5eFIUcfz9gVVkCqorwH2KiZzMGhW6uHaj0lQnSSbQZu4rCH8QeFaI oK9w== X-Gm-Message-State: ABUngve+o4XgPdqQpIrh/ROUV1N6oXE8uWsKe15/rkX2lfh7ZQ5rCx1UfyEJGZhbXv8VfsJ9 X-Received: by 10.99.48.68 with SMTP id w65mr32094311pgw.68.1479156529343; Mon, 14 Nov 2016 12:48:49 -0800 (PST) Received: from ?IPv6:2601:646:c401:d400:8813:88db:af70:a483? ([2601:646:c401:d400:8813:88db:af70:a483]) by smtp.gmail.com with ESMTPSA id k67sm37244511pfk.69.2016.11.14.12.48.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 12:48:48 -0800 (PST) From: Denis Magda Content-Type: multipart/alternative; boundary="Apple-Mail=_8FA88513-F732-4D41-82BC-DB3CB1D009D4" Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: Remote Server Thread Not exit when Job finished,Cause out of memory Date: Mon, 14 Nov 2016 12:48:47 -0800 References: <1479114984128-8934.post@n6.nabble.com> <1479121022925-8938.post@n6.nabble.com> <1479123354282-8939.post@n6.nabble.com> <1479130910085-8947.post@n6.nabble.com> To: user@ignite.apache.org In-Reply-To: <1479130910085-8947.post@n6.nabble.com> Message-Id: X-Mailer: Apple Mail (2.3251) archived-at: Mon, 14 Nov 2016 20:49:17 -0000 --Apple-Mail=_8FA88513-F732-4D41-82BC-DB3CB1D009D4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 You may want to implement ComputeJobMasterLeaveAware [1] interface for = your compute jobs. An interface implementation will be called on servers = side for every job that was spawned by client node that has been shut = down. Besides, you can refer to this example [2] that demonstrates how to use = the interface. However, I still don=E2=80=99t see a reason why you spawn 6 threads for = every compute job. In general you may reuse existing threads from the = public pool by relying on ComputeJobContinuation [3] which usage is = demonstrated in this example [4]. [1] = https://ignite.apache.org/releases/1.7.0/javadoc/org/apache/ignite/compute= /ComputeJobMasterLeaveAware.html = [2] = https://github.com/gridgain/gridgain-advanced-examples/blob/master/src/mai= n/java/org/gridgain/examples/compute/masterleave/ComputeMasterLeaveAwareEx= ample.java [3] = https://ignite.apache.org/releases/1.7.0/javadoc/org/apache/ignite/compute= /ComputeJobContinuation.html = [4] = https://github.com/apache/ignite/blob/master/examples/src/main/java/org/ap= ache/ignite/examples/computegrid/ComputeFibonacciContinuationExample.java = =E2=80=94 Denis > On Nov 14, 2016, at 5:41 AM, alex wrote: >=20 > Hi vdpyatkov, I tried like this , problem still exists. The client = code just > as below: >=20 > ClusterGroup rmts =3D getIgnite().cluster().forRemotes(); > IgniteCompute compute =3D = getIgnite().compute(rmts).withAsync(); > compute.apply(new IgniteClosure() { > @Override > public String apply(String o) { > return o; > } > }, Arrays.asList("Print words using runnable".split(" "))); >=20 > IgniteFuture future =3D compute.future(); > future.cancel(); >=20 > getIgnite().close(); >=20 >=20 >=20 > -- > View this message in context: = http://apache-ignite-users.70518.x6.nabble.com/Remote-Server-Thread-Not-ex= it-when-Job-finished-Cause-out-of-memory-tp8934p8947.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. --Apple-Mail=_8FA88513-F732-4D41-82BC-DB3CB1D009D4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 You may want to implement ComputeJobMasterLeaveAware [1] = interface for your compute jobs. An interface implementation will be = called on servers side for every job that was spawned by client node = that has been shut down.

Besides, you can refer to this example [2] that demonstrates = how to use the interface.

However, I still don=E2=80=99t see a reason why you spawn 6 = threads for every compute job. In general you may reuse existing threads = from the public pool by relying on ComputeJobContinuation [3] which = usage is demonstrated in this example [4].


=E2=80=94
Denis

On = Nov 14, 2016, at 5:41 AM, alex <alexwang58@gmail.com> wrote:

Hi = vdpyatkov, I tried like this , problem still exists. The client code = just
as below:

=        ClusterGroup rmts =3D = getIgnite().cluster().forRemotes();
=        IgniteCompute compute =3D = getIgnite().compute(rmts).withAsync();
=        compute.apply(new = IgniteClosure<String, String>() {
=            @Overrid= e
=            public = String apply(String o) {
=             &n= bsp;  return o;
=            }
       }, = Arrays.asList("Print words using runnable".split(" ")));
       IgniteFuture = future =3D compute.future();
=        future.cancel();

=        getIgnite().close();



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Remote-Server-Th= read-Not-exit-when-Job-finished-Cause-out-of-memory-tp8934p8947.htmlSent from the Apache Ignite Users mailing list archive at = Nabble.com.

= --Apple-Mail=_8FA88513-F732-4D41-82BC-DB3CB1D009D4--