Skip to main content

[archive] Cobol calling Java - memory problem

  • May 8, 2008
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 07 May 2008]

Hello to everyone,
I have a problem with the allocation of memory after a call of a java class from cobol; the problem is that the memory used by wrun32 (I use acucobolGt 7.0.1 for windows) increase itself after a call like this:

CALL "C$JAVA" USING
CJAVA-NEW, "it/name1/name2/name3/Model",
methodSignature,
modelName, inputName, inputFileDName,
inputPdf, outputName
GIVING OBJECT-HANDLE.

and don't decrease completely itself after destroy java object:

CALL "C$JAVA" USING CJAVA-DESTROY, OBJECT-HANDLE
GIVING STATUS-VAL.

so every call to the constructor (cjava-new opcode) the memory take a consistent portion of total system memory.

In other case using javaArray and a call-static, the system fault with a "Access memory violation" error.

Where I wrong?

(you excuse me for my poor English)

Umberto

4 replies

[Migrated content. Thread originally posted on 07 May 2008]

Hello to everyone,
I have a problem with the allocation of memory after a call of a java class from cobol; the problem is that the memory used by wrun32 (I use acucobolGt 7.0.1 for windows) increase itself after a call like this:

CALL "C$JAVA" USING
CJAVA-NEW, "it/name1/name2/name3/Model",
methodSignature,
modelName, inputName, inputFileDName,
inputPdf, outputName
GIVING OBJECT-HANDLE.

and don't decrease completely itself after destroy java object:

CALL "C$JAVA" USING CJAVA-DESTROY, OBJECT-HANDLE
GIVING STATUS-VAL.

so every call to the constructor (cjava-new opcode) the memory take a consistent portion of total system memory.

In other case using javaArray and a call-static, the system fault with a "Access memory violation" error.

Where I wrong?

(you excuse me for my poor English)

Umberto
Hi,

We discovered a couple of quite severe memory leaks with V7.2.0 after we upgraded from 6.1.
These all seem to be fixed in V8.0
From memory it was something to do with mirrored handles in the runtime.
The memory leaks were only in thin client if I remember correctly.

Shaun

[Migrated content. Thread originally posted on 07 May 2008]

Hello to everyone,
I have a problem with the allocation of memory after a call of a java class from cobol; the problem is that the memory used by wrun32 (I use acucobolGt 7.0.1 for windows) increase itself after a call like this:

CALL "C$JAVA" USING
CJAVA-NEW, "it/name1/name2/name3/Model",
methodSignature,
modelName, inputName, inputFileDName,
inputPdf, outputName
GIVING OBJECT-HANDLE.

and don't decrease completely itself after destroy java object:

CALL "C$JAVA" USING CJAVA-DESTROY, OBJECT-HANDLE
GIVING STATUS-VAL.

so every call to the constructor (cjava-new opcode) the memory take a consistent portion of total system memory.

In other case using javaArray and a call-static, the system fault with a "Access memory violation" error.

Where I wrong?

(you excuse me for my poor English)

Umberto
Hi,

We discovered a couple of quite severe memory leaks with V7.2.0 after we upgraded from 6.1.
These all seem to be fixed in V8.0
From memory it was something to do with mirrored handles in the runtime.
The memory leaks were only in thin client if I remember correctly.

Shaun

[Migrated content. Thread originally posted on 07 May 2008]

Hello to everyone,
I have a problem with the allocation of memory after a call of a java class from cobol; the problem is that the memory used by wrun32 (I use acucobolGt 7.0.1 for windows) increase itself after a call like this:

CALL "C$JAVA" USING
CJAVA-NEW, "it/name1/name2/name3/Model",
methodSignature,
modelName, inputName, inputFileDName,
inputPdf, outputName
GIVING OBJECT-HANDLE.

and don't decrease completely itself after destroy java object:

CALL "C$JAVA" USING CJAVA-DESTROY, OBJECT-HANDLE
GIVING STATUS-VAL.

so every call to the constructor (cjava-new opcode) the memory take a consistent portion of total system memory.

In other case using javaArray and a call-static, the system fault with a "Access memory violation" error.

Where I wrong?

(you excuse me for my poor English)

Umberto
Hi,

We discovered a couple of quite severe memory leaks with V7.2.0 after we upgraded from 6.1.
These all seem to be fixed in V8.0
From memory it was something to do with mirrored handles in the runtime.
The memory leaks were only in thin client if I remember correctly.

Shaun


Hello, thanks for your answer.
Fortunately now I have resolved the error (Memory access violation) not using JavaArray and CJAVA-CALLSTATIC.

Now, what I want to know it's if exist some trick from being able to adopt in order to optimize the used memory and if possible to know the difference between the calls:

CALL " C$JAVA" USING CJAVA-DESTROY, OBJECT-HANDLE
GIVING STATUS-VAL.

and

CALL " C$JAVA" USING CJAVA-DELETE, OBJECT-HANDLE
GIVING STATUS-VAL.

thanks to all

[Migrated content. Thread originally posted on 07 May 2008]

Hello to everyone,
I have a problem with the allocation of memory after a call of a java class from cobol; the problem is that the memory used by wrun32 (I use acucobolGt 7.0.1 for windows) increase itself after a call like this:

CALL "C$JAVA" USING
CJAVA-NEW, "it/name1/name2/name3/Model",
methodSignature,
modelName, inputName, inputFileDName,
inputPdf, outputName
GIVING OBJECT-HANDLE.

and don't decrease completely itself after destroy java object:

CALL "C$JAVA" USING CJAVA-DESTROY, OBJECT-HANDLE
GIVING STATUS-VAL.

so every call to the constructor (cjava-new opcode) the memory take a consistent portion of total system memory.

In other case using javaArray and a call-static, the system fault with a "Access memory violation" error.

Where I wrong?

(you excuse me for my poor English)

Umberto
The two are equivalent. You can use either one.