Skip to content

OutOfMemoryError in eta.runtime.io.ByteArray.create #552

@rpeszek

Description

@rpeszek

This program causes OutOfMemory Error:

main :: IO ()
main = do print $ M.mimeByExt M.defaultMimeMap "application/text" "test.js"

it needs mime-types package and

{-# LANGUAGE OverloadedStrings #-}
import qualified Network.Mime as M

Stacktrace:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
	at eta.runtime.io.MemoryManager.allocateAnonymousBuffer(MemoryManager.java:287)
	at eta.runtime.io.MemoryManager.allocateBuffer(MemoryManager.java:213)
	at eta.runtime.io.ByteArray.create(ByteArray.java:25)
	at eta.runtime.io.ByteArray.create(ByteArray.java:21)
	at eta.runtime.io.ByteArray.create(ByteArray.java:17)
	at mime_types.network.Mime$$wfileNameExtensions.enter(Mime.hs:56)
	at mime_types.network.Mime$$wmimeByExt.enter(Mime.hs:39)
	at main.Main$main3.thunkEnter(Main.hs:7)
	at eta.runtime.thunk.CAF.evaluate(CAF.java:29)
	at base.ghc.io.handle.Text$$wa7.enter(Text.hs:586)
	at base.ghc.io.handle.Text$hPutStr2.apply3V(Text.hs:553)
	at main.Main$main1.applyV(Main.hs:7)
	at main.Main$DZCmain.applyV(Main.hs)
	at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:104)
	at eta.runtime.stg.Capability.schedule(Capability.java:157)
	at eta.runtime.stg.Capability.scheduleClosure(Capability.java:102)
	at eta.runtime.Runtime.evalLazyIO(Runtime.java:189)
	at eta.runtime.Runtime.main(Runtime.java:182)
	at eta.main.main(Unknown Source)

I will attach URO to minimal program that contains this code after this ticket is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions