Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScalaCL and memory leaks. #15

Open
ochafik opened this issue Mar 16, 2015 · 1 comment
Open

ScalaCL and memory leaks. #15

ochafik opened this issue Mar 16, 2015 · 1 comment

Comments

@ochafik
Copy link
Member

ochafik commented Mar 16, 2015

From @jopasserat on January 2, 2012 21:53

Hi Olivier,

My second problem succeeding to issue #221 close is the following:

Having rebuilt the ScalaCL sbaz integrating your recent changes, I now encounter memory leaks. When running the ScalaCL code of your tutorial directly in the scala shell (http://code.google.com/p/scalacl/wiki/FAQ), I get an OutOfMemoryError exception when invoking map on the 1,000,000 entries CLArray.

This code used to process without any problem with ScalaCL 0.2 on two different machines running JVM 6 and 7.

A certainly related problem appears when running a small project of mine built with Maven (my local repository is up to date with ScalaCL since I rebuilt it on the same machine). The program runs well but crashes when quitting:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fec86122000, pid=5987, tid=140653859129088
#
# JRE version: 7.0_147-b147
# Java VM: OpenJDK 64-Bit Server VM (21.0-b17 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea7 2.0
# Distribution: Debian GNU/Linux unstable (sid), package 7~b147-2.0-1
# Problematic frame:
# C  0x00007fec86122000
[error occurred during error reporting (printing problematic frame), id 0xb]

# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid5987.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#
Aborted

Here is a part of the aforementioned hs_err_pid5987.log file that could interest you:

Instructions: (pc=0x00007fec86122000)
0x00007fec86121fe0:
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb]

Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x0000000749f73228 is an oop
java.lang.Class
 - klass: 'java/lang/Class'
RCX=0x0000000000000002 is an unknown value
RDX=0x00007fec874f3310 is pointing into the stack for thread: 0x0000000000ead800
RSP=0x00007fec874f3308 is pointing into the stack for thread: 0x0000000000ead800
RBP=0x00007fec874f3360 is pointing into the stack for thread: 0x0000000000ead800
RSI=0x00007fec874f3340 is pointing into the stack for thread: 0x0000000000ead800
RDI=0x0000000000ead9d0 is an unknown value
R8 =0x000000074774a220 is an oop
com.nativelibs4java.opencl.CLEvent
 - klass: 'com/nativelibs4java/opencl/CLEvent'
R9 =0x00007fec874f3588 is pointing into the stack for thread: 0x0000000000ead800
R10=0x0000000000000002 is an unknown value
R11=0x000000074774a220 is an oop
com.nativelibs4java.opencl.CLEvent
 - klass: 'com/nativelibs4java/opencl/CLEvent'
R12=0x0000000000000000 is an unknown value
R13=0x00007fec874f3348 is pointing into the stack for thread: 0x0000000000ead800
R14=0x00007fec874f3340 is pointing into the stack for thread: 0x0000000000ead800
R15=0x0000000000ead800 is a thread


Stack: [0x00007fec873f4000,0x00007fec874f5000],  sp=0x00007fec874f3308,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00007fec86122000
[error occurred during error reporting (printing native stack), id 0xb]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  com.nativelibs4java.opencl.library.OpenCLLibrary.clReleaseEvent(Lcom/nativelibs4java/opencl/library/OpenCLLibrary$cl_event;)I
J  com.nativelibs4java.opencl.CLAbstractEntity.finalize()V
v  ~StubRoutines::call_stub
J  java.lang.ref.Finalizer.invokeFinalizeMethod(Ljava/lang/Object;)V
J  java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;)V
J  java.lang.ref.Finalizer$FinalizerThread.run()V
v  ~StubRoutines::call_stub

Regards,

Copied from original issue: nativelibs4java/nativelibs4java#223

@ochafik
Copy link
Member Author

ochafik commented Mar 16, 2015

Hi jHack,

Thanks for your report !
I've started to see this issue myself recently, will investigate asap (might be caused by BridJ, since not much has changed in JavaCL & ScalaCL Collections).

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant