From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50735 invoked by alias); 25 Apr 2018 21:13:54 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 50726 invoked by uid 89); 25 Apr 2018 21:13:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*r:4.89, H*x:1.6, H*UA:1.6, occasion X-HELO: homiemail-a75.g.dreamhost.com Received: from sub3.mail.dreamhost.com (HELO homiemail-a75.g.dreamhost.com) (69.163.253.7) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Apr 2018 21:13:52 +0000 Received: from homiemail-a75.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTP id C74EC5EC083 for ; Wed, 25 Apr 2018 14:13:50 -0700 (PDT) Received: from vpaur.eip10.org (cpe-74-75-122-130.maine.res.rr.com [74.75.122.130]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: chaw@eip10.org) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTPSA id A4E3B5EC082 for ; Wed, 25 Apr 2018 14:13:50 -0700 (PDT) Received: from chaw by vpaur.eip10.org with local (Exim 4.89) (envelope-from ) id 1fBRjZ-0003vm-ER for kawa@sourceware.org; Wed, 25 Apr 2018 17:13:49 -0400 To: Kawa mailing list Subject: SRFI 41 "times3" example exhausts memory? From: "Sudarshan S Chawathe" Reply-To: "Sudarshan S Chawathe" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15112.1524690829.1@vpaur.eip10.org> Content-Transfer-Encoding: quoted-printable Date: Wed, 25 Apr 2018 21:13:00 -0000 Message-ID: <15113.1524690829@vpaur.eip10.org> X-IsSubscribed: yes X-SW-Source: 2018-q2/txt/msg00005.txt.bz2 I had occasion to revisit the SRFI 41 streams library in Kawa and decided to try out a problematic "times3" example noted in the SRFI document. It ran successfully for small values of the argument but gave a OutOfMemoryError when invoked as (times3 #e1e7). (Details below.) I am not sure if this is a known limitation of the Kawa implementation of SRFI 41 or if the problem is elsewhere, which is why I am not reporting it as a bug/issue on Gitlab. In any case, I thought I'd mention the issue here on the mailing list to check if others have any thoughts on the matter. Regards, -chaw ** test.scm: =20=20 (import (scheme base) (srfi 41)) (define (times3 n) (stream-ref (stream-filter (lambda (x) (zero? (modulo x n))) (stream-from 0)) 3)) (display (times3 #e1e7)) (newline) ** trace: $ time kawa test.scm Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit = exceeded at gnu.expr.CompiledProc.makeResultToObject(CompiledProc.java:41) at gnu.kawa.slib.StreamsDerived$frame16.(StreamsDerived.scm) at gnu.kawa.slib.StreamsDerived$frame15.lambda35streamFrom(StreamsDerive= d.scm:169) at gnu.kawa.slib.StreamsDerived$frame16.lambda38(StreamsDerived.scm:170) at gnu.kawa.slib.StreamsDerived$frame16.lambda38$check(StreamsDerived.sc= m:170) at java.lang.invoke.LambdaForm$DMH/702846463.invokeStatic_LL_L(LambdaFor= m$DMH) at java.lang.invoke.LambdaForm$MH/1169794610.invokeExact_MT(LambdaForm$M= H) at gnu.mapping.CallContext.runUntilValue(CallContext.java:656) at gnu.mapping.Procedure.apply0(Procedure.java:142) at gnu.mapping.Promise.getValue(Promise.java:80) at gnu.kawa.slib.StreamsPrimitive.isStreamNull(StreamsPrimitive.scm:52) at gnu.kawa.slib.StreamsDerived$frame14.lambda31(StreamsDerived.scm:145) at gnu.kawa.slib.StreamsDerived$frame14.lambda31$check(StreamsDerived.sc= m:144) at java.lang.invoke.LambdaForm$DMH/1316557528.invokeStatic_LL_L(LambdaFo= rm$DMH) at java.lang.invoke.LambdaForm$MH/1169794610.invokeExact_MT(LambdaForm$M= H) at gnu.mapping.CallContext.runUntilValue(CallContext.java:656) at gnu.mapping.Procedure.apply0(Procedure.java:142) at gnu.mapping.Promise.getValue(Promise.java:80) at gnu.kawa.slib.StreamsPrimitive.isStreamNull(StreamsPrimitive.scm:52) at gnu.kawa.slib.StreamsDerived.streamRef(StreamsDerived.scm:275) at test.times3(test.scm:10) at test.times3$check(test.scm:4) at java.lang.invoke.LambdaForm$DMH/284720968.invokeStaticInit_LL_L(Lambd= aForm$DMH) at java.lang.invoke.LambdaForm$MH/1169794610.invokeExact_MT(LambdaForm$M= H) at gnu.mapping.CallContext.runUntilValue(CallContext.java:656) at gnu.mapping.Procedure.apply1(Procedure.java:148) at test.run(test.scm:12) at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:289) at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42) at gnu.expr.CompiledModule.evalModule(CompiledModule.java:60) at kawa.Shell.runFile(Shell.java:565) at kawa.Shell.runFileOrClass(Shell.java:468) real 6m12.696s user 17m16.376s sys 0m2.188s ** versions Kawa 3.0 (git describe: 3.0-87-g5fa934dad-dirty) Copyright (C) 2018 Per Bothner openjdk version "1.8.0_162" OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1~deb9u1-b12) OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode) =20=20=20