Java memory leak running jni through swig
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-7 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I installed swig2.0 and swig2.0-examples and then modified the examples in 2 ways. First I unzipped swig2.0-
JAVA_INCLUDE= -I"/usr/
Then I edited the file swig2.0-
public static void main(String argv[])
{
// ----- Object creation -----
for (int i = 0; i < 10000; i++)
{
for (int j = 0; j < 10000; j++)
{
}
}
When I run I see the memory usage for the process increase until it hits around 25% of total memory. Then the process starts running very slowly (I think it is trying to find free memory). Finally it crashes with the error:
Exception in thread "main" java.lang.
at runme.main(
Interestingly, this error does not occur on a different system which also has Ubuntu 12.04 and openjdk-7-jre but which is a 32-bit i386 architecture.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: openjdk-
ProcVersionSign
Uname: Linux 3.2.0-23-generic x86_64
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu12
Architecture: amd64
Date: Thu Aug 9 11:17:30 2012
ExecutablePath: /usr/lib/
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
LocalLibraries: /home/nks/
ProcEnviron:
SHELL=/bin/bash
TERM=dumb
PATH=(custom, user)
LANG=en_US.UTF-8
SourcePackage: openjdk-7
UpgradeStatus: No upgrade log present (probably fresh install)