commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Otmar Ertl (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-1262) Heap overflow in org.apache.commons.math4.special.BesselJ
Date Tue, 25 Aug 2015 15:47:46 GMT

    [ https://issues.apache.org/jira/browse/MATH-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14711484#comment-14711484
] 

Otmar Ertl commented on MATH-1262:
----------------------------------

The current implementation allocates a double array with size equal to order+1. Hence, the
OutOfMemoryError is not very surprising in this case with order equal to 1182054491. To fix
this, we would need to implement a more space efficient algorithm like the one used in boost,
see https://github.com/mirror/boost/blob/master/boost/math/special_functions/detail/bessel_jn.hpp.

> Heap overflow in org.apache.commons.math4.special.BesselJ
> ---------------------------------------------------------
>
>                 Key: MATH-1262
>                 URL: https://issues.apache.org/jira/browse/MATH-1262
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Neil Walkinshaw
>            Priority: Minor
>              Labels: newbie, performance
>
> This test case:
> {code:java}
> import org.apache.commons.math4.special.BesselJ;
> public class BesselJHeapBug {
>     public static void main(String[] args) {
>         BesselJ.value(1182054491, 3.589635306407856E-8D);
>     }
> }
> {code}
> throws the following exception:
> {code}
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
> 	at org.apache.commons.math4.special.BesselJ.rjBesl(BesselJ.java:247)
> 	at org.apache.commons.math4.special.BesselJ.value(BesselJ.java:161)
> 	at BesselJHeapBug.main(BesselJHeapBug.java:5)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message