ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Ignatenko (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IGNITE-6394) Can't create off-heap matrix with size over 2 Gb (int overflow in DenseOffHeapMatrixStorage.allocateMemory)
Date Fri, 15 Sep 2017 11:26:00 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-6394?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Ignatenko updated IGNITE-6394:
-----------------------------------
    Description: 
In order to reproduce, try to create off-heap matrix with size larger than 2Gb, eg like this:

{code}new DenseLocalOffHeapMatrix(17_000, 17_000){code}

Above fails:
{noformat}
java.lang.IllegalArgumentException: null
        at sun.misc.Unsafe.allocateMemory(Native Method)
        at org.apache.ignite.internal.util.GridUnsafe.allocateMemory(GridUnsafe.java:1068)
        at org.apache.ignite.ml.math.impls.storage.matrix.DenseOffHeapMatrixStorage.allocateMemory(DenseOffHeapMatrixStorage.java:219)
        ...
{noformat}

(you may need to allow Java get more than 2Gb off-heap memory for that with VM argument like
{{-XX:MaxDirectMemorySize=1000g}})

The reason for failure is that int arguments aren't converted to long prior to multiplying
in {{DenseOffHeapMatrixStorage.allocateMemory}}:

{code}ptr = GridUnsafe.allocateMemory(rows * cols * Double.BYTES);{code}

  was:
In order to reproduce, try to create off-heap matrix with size larger than 2Gb, eg like this:

{code}new DenseLocalOffHeapMatrix(17_000, 17_000){code}

Above fails:
{noformat}
java.lang.IllegalArgumentException: null
        at sun.misc.Unsafe.allocateMemory(Native Method)
        at org.apache.ignite.internal.util.GridUnsafe.allocateMemory(GridUnsafe.java:1068)
        at org.apache.ignite.ml.math.impls.storage.matrix.DenseOffHeapMatrixStorage.allocateMemory(DenseOffHeapMatrixStorage.java:219)
        ...
{noformat}

(you may need to allow Java get more than 2Gb off-heap memory for that with VM argument like
{{-XX:MaxDirectMemorySize=1000g}})

The reason for failure is that int arguments aren't converted to long prior to multiplying
in {{DenseOffHeapMatrixStorage.allocateMemory}}:

{code}ptr = GridUnsafe.allocateMemory((long)rows * cols * Double.BYTES);{code}


> Can't create off-heap matrix with size over 2 Gb (int overflow in DenseOffHeapMatrixStorage.allocateMemory)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-6394
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6394
>             Project: Ignite
>          Issue Type: Bug
>          Components: ml
>            Reporter: Oleg Ignatenko
>            Assignee: Yury Babak
>
> In order to reproduce, try to create off-heap matrix with size larger than 2Gb, eg like
this:
> {code}new DenseLocalOffHeapMatrix(17_000, 17_000){code}
> Above fails:
> {noformat}
> java.lang.IllegalArgumentException: null
>         at sun.misc.Unsafe.allocateMemory(Native Method)
>         at org.apache.ignite.internal.util.GridUnsafe.allocateMemory(GridUnsafe.java:1068)
>         at org.apache.ignite.ml.math.impls.storage.matrix.DenseOffHeapMatrixStorage.allocateMemory(DenseOffHeapMatrixStorage.java:219)
>         ...
> {noformat}
> (you may need to allow Java get more than 2Gb off-heap memory for that with VM argument
like {{-XX:MaxDirectMemorySize=1000g}})
> The reason for failure is that int arguments aren't converted to long prior to multiplying
in {{DenseOffHeapMatrixStorage.allocateMemory}}:
> {code}ptr = GridUnsafe.allocateMemory(rows * cols * Double.BYTES);{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message