From 9d88340079e96a1e874f2ccde185374dc35a7736 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Wed, 10 May 2023 23:58:26 +0200 Subject: [PATCH 1/2] close client to prevent file handle leak --- src/java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java/README.md b/src/java/README.md index 067374130..9cd74b8a2 100644 --- a/src/java/README.md +++ b/src/java/README.md @@ -78,6 +78,7 @@ public class MinExample { InferenceServerClient client = new InferenceServerClient("0.0.0.0:8000", 5000, 5000); InferResult result = client.infer("roberta", inputs, outputs); + client.close(); float[] logits = result.getOutputAsFloat("logits"); System.out.println(Arrays.toString(logits)); } From 18d3ccf9a1fcc9a1d31836af80e692624e5cd2c5 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 11 May 2023 00:01:51 +0200 Subject: [PATCH 2/2] close client to prevent file handle leak --- .../src/main/java/triton/client/examples/MemoryGrowthTest.java | 1 + .../src/main/java/triton/client/examples/SimpleInferClient.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/java/src/main/java/triton/client/examples/MemoryGrowthTest.java b/src/java/src/main/java/triton/client/examples/MemoryGrowthTest.java index daaaba7de..985c8b562 100644 --- a/src/java/src/main/java/triton/client/examples/MemoryGrowthTest.java +++ b/src/java/src/main/java/triton/client/examples/MemoryGrowthTest.java @@ -57,6 +57,7 @@ public static void main(String[] args) throws Exception InferenceServerClient client = new InferenceServerClient("0.0.0.0:8000", 5000, 5000); InferResult result = client.infer("custom_identity_int32", inputs, outputs); + client.close(); // Get the output arrays from the results and verify int[] output0 = result.getOutputAsInt("OUTPUT0"); diff --git a/src/java/src/main/java/triton/client/examples/SimpleInferClient.java b/src/java/src/main/java/triton/client/examples/SimpleInferClient.java index 50d26e04b..6be50a1bd 100644 --- a/src/java/src/main/java/triton/client/examples/SimpleInferClient.java +++ b/src/java/src/main/java/triton/client/examples/SimpleInferClient.java @@ -65,6 +65,7 @@ public static void main(String[] args) throws Exception InferenceServerClient client = new InferenceServerClient("0.0.0.0:8000", 5000, 5000); InferResult result = client.infer("simple", inputs, outputs); + client.close(); // Get the output arrays from the results int[] op0 = result.getOutputAsInt("OUTPUT0");