Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Memory leak for java proxy methods returning String

5 posts in EJB Client Last posting was on 2004-09-15 22:05:53.0Z
Vlad Zlotskiy Posted on 2004-09-08 22:06:36.0Z
From: "Vlad Zlotskiy" <vladz@imsi.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Memory leak for java proxy methods returning String
Lines: 48
Organization: IMS
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Original-NNTP-Posting-Host: exit.imsi.com
Message-ID: <413f840d$1@forums-2-dub>
X-Original-Trace: 8 Sep 2004 15:13:33 -0700, exit.imsi.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Sep 2004 14:55:08 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 8 Sep 2004 15:06:36 -0700
X-Trace: forums-1-dub 1094681196 10.22.108.75 (8 Sep 2004 15:06:36 -0700)
X-Original-Trace: 8 Sep 2004 15:06:36 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:359
Article PK: 424534

I have run into memory leak, when calling methods on Java proxy objects
returning String from the java class. Looks like JVM does not garbage
collect chunks of memory it returns to the calling PB thread. I read from
variuos JNI threads that it has something to do with the way native app
realeases memory on JVM calls. If it is not properly done jvm still thinks
that memory is being used and does not garbage collect it. Since pbjvm90.dll
is a black box, I have no way to verify it or control . I wonder if anyone
else experienced similar problems: I am running PB 9.01 Build 7204 with PB9
supplied jdk 1.4.
I have used a simple java class that has method returning 2K String with PB
calling it in a loop. I have used SysInternals process monitor to observe
the memory leak.

//***********Java Code************
public class MemoryLeak
{
public String testMemoryLeak() {
StringBuffer my_buffer = new StringBuffer(2000);
for (int i=0;i < 2000;i++) my_buffer.append("*");
return my_buffer.toString();
}
}

//***********PB code*************
EJBConnection lEJBConn
MemoryLeak lj_ml
String value
int i

If NOT IsValid(i_javavm) Then
i_javavm = CREATE JavaVM
i_javavm.CreateJavaVM("", False)
End if
lEJBConn = CREATE EJBConnection
lEJBConn.CreateJavaInstance(lj_ml, "MemoryLeak")
try
For i =0 to Dec(sle_count.text)
value = lj_ml.testmemoryleak( )
Next

catch (Exception e)
MessageBox(" Other Exception", e.getMessage())
end try


Ben (bede) Posted on 2004-09-09 09:37:43.0Z
From: Ben (bede) <bedeNOSP@Msofico.be>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Memory leak for java proxy methods returning String
Message-ID: <MPG.1baa4082ac65a14b9896a1@forums.sybase.com>
References: <413f840d$1@forums-2-dub>
Organization: Sofico
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
User-Agent: MicroPlanet-Gravity/2.70.2067
X-Original-NNTP-Posting-Host: uu194-7-38-226.unknown.uunet.be
X-Original-Trace: 9 Sep 2004 02:44:30 -0700, uu194-7-38-226.unknown.uunet.be
Lines: 53
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Sep 2004 02:26:06 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Sep 2004 02:37:43 -0700
X-Trace: forums-1-dub 1094722663 10.22.108.75 (9 Sep 2004 02:37:43 -0700)
X-Original-Trace: 9 Sep 2004 02:37:43 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:360
Article PK: 424537

Maybe it's a good idea to submit it as a bug.


In article <413f840d$1@forums-2-dub>, vladz@imsi.com says...

> I have run into memory leak, when calling methods on Java proxy objects
> returning String from the java class. Looks like JVM does not garbage
> collect chunks of memory it returns to the calling PB thread. I read from
> variuos JNI threads that it has something to do with the way native app
> realeases memory on JVM calls. If it is not properly done jvm still thinks
> that memory is being used and does not garbage collect it. Since pbjvm90.dll
> is a black box, I have no way to verify it or control . I wonder if anyone
> else experienced similar problems: I am running PB 9.01 Build 7204 with PB9
> supplied jdk 1.4.
> I have used a simple java class that has method returning 2K String with PB
> calling it in a loop. I have used SysInternals process monitor to observe
> the memory leak.
>
> //***********Java Code************
> public class MemoryLeak
> {
> public String testMemoryLeak() {
> StringBuffer my_buffer = new StringBuffer(2000);
> for (int i=0;i < 2000;i++) my_buffer.append("*");
> return my_buffer.toString();
> }
> }
>
> //***********PB code*************
> EJBConnection lEJBConn
> MemoryLeak lj_ml
> String value
> int i
>
> If NOT IsValid(i_javavm) Then
> i_javavm = CREATE JavaVM
> i_javavm.CreateJavaVM("", False)
> End if
> lEJBConn = CREATE EJBConnection
> lEJBConn.CreateJavaInstance(lj_ml, "MemoryLeak")
> try
> For i =0 to Dec(sle_count.text)
> value = lj_ml.testmemoryleak( )
> Next
>
> catch (Exception e)
> MessageBox(" Other Exception", e.getMessage())
> end try
>
>
>
>
>
>


Vlad Zlotskiy Posted on 2004-09-15 16:57:47.0Z
From: "Vlad Zlotskiy" <vladz@imsi.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <413f840d$1@forums-2-dub>
Subject: Re: Memory leak for java proxy methods returning String
Lines: 60
Organization: IMS
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: exit.imsi.com
X-Original-NNTP-Posting-Host: exit.imsi.com
Message-ID: <4148748b$1@forums-1-dub>
Date: 15 Sep 2004 09:57:47 -0700
X-Trace: forums-1-dub 1095267467 199.253.174.9 (15 Sep 2004 09:57:47 -0700)
X-Original-Trace: 15 Sep 2004 09:57:47 -0700, exit.imsi.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:365
Article PK: 424539

Does anyone from Sybase Team has comments on this ? The memory leak on
String result makes it impossible to use PB to Java interface.

"Vlad Zlotskiy" <vladz@imsi.com> wrote in message
news:413f840d$1@forums-2-dub...
> I have run into memory leak, when calling methods on Java proxy objects
> returning String from the java class. Looks like JVM does not garbage
> collect chunks of memory it returns to the calling PB thread. I read from
> variuos JNI threads that it has something to do with the way native app
> realeases memory on JVM calls. If it is not properly done jvm still thinks
> that memory is being used and does not garbage collect it. Since
pbjvm90.dll
> is a black box, I have no way to verify it or control . I wonder if
anyone
> else experienced similar problems: I am running PB 9.01 Build 7204 with
PB9
> supplied jdk 1.4.
> I have used a simple java class that has method returning 2K String with
PB
> calling it in a loop. I have used SysInternals process monitor to observe
> the memory leak.
>
> //***********Java Code************
> public class MemoryLeak
> {
> public String testMemoryLeak() {
> StringBuffer my_buffer = new StringBuffer(2000);
> for (int i=0;i < 2000;i++) my_buffer.append("*");
> return my_buffer.toString();
> }
> }
>
> //***********PB code*************
> EJBConnection lEJBConn
> MemoryLeak lj_ml
> String value
> int i
>
> If NOT IsValid(i_javavm) Then
> i_javavm = CREATE JavaVM
> i_javavm.CreateJavaVM("", False)
> End if
> lEJBConn = CREATE EJBConnection
> lEJBConn.CreateJavaInstance(lj_ml, "MemoryLeak")
> try
> For i =0 to Dec(sle_count.text)
> value = lj_ml.testmemoryleak( )
> Next
>
> catch (Exception e)
> MessageBox(" Other Exception", e.getMessage())
> end try
>
>
>
>
>


Jim O'Neil [Sybase] Posted on 2004-09-15 19:50:18.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.powerbuilder.ejbclient
Subject: Re: Memory leak for java proxy methods returning String
Message-ID: <mf6hk0laka89sp9p8tskd9q9r6vv8bqfl3@4ax.com>
References: <413f840d$1@forums-2-dub> <4148748b$1@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-Trace: 15 Sep 2004 12:57:40 -0700, joneilw2k.sybase.com
Lines: 66
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 15 Sep 2004 12:38:09 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 15 Sep 2004 12:50:18 -0700
X-Trace: forums-1-dub 1095277818 10.22.108.75 (15 Sep 2004 12:50:18 -0700)
X-Original-Trace: 15 Sep 2004 12:50:18 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:366
Article PK: 424540

Well, your scenario seems straightforward enough. have you submitted
the bug as Ben suggested? That's the mechanism to get it fixed.

On 15 Sep 2004 09:57:47 -0700, "Vlad Zlotskiy" <vladz@imsi.com>

wrote:

>Does anyone from Sybase Team has comments on this ? The memory leak on
>String result makes it impossible to use PB to Java interface.
>
>
>"Vlad Zlotskiy" <vladz@imsi.com> wrote in message
>news:413f840d$1@forums-2-dub...
>> I have run into memory leak, when calling methods on Java proxy objects
>> returning String from the java class. Looks like JVM does not garbage
>> collect chunks of memory it returns to the calling PB thread. I read from
>> variuos JNI threads that it has something to do with the way native app
>> realeases memory on JVM calls. If it is not properly done jvm still thinks
>> that memory is being used and does not garbage collect it. Since
>pbjvm90.dll
>> is a black box, I have no way to verify it or control . I wonder if
>anyone
>> else experienced similar problems: I am running PB 9.01 Build 7204 with
>PB9
>> supplied jdk 1.4.
>> I have used a simple java class that has method returning 2K String with
>PB
>> calling it in a loop. I have used SysInternals process monitor to observe
>> the memory leak.
>>
>> //***********Java Code************
>> public class MemoryLeak
>> {
>> public String testMemoryLeak() {
>> StringBuffer my_buffer = new StringBuffer(2000);
>> for (int i=0;i < 2000;i++) my_buffer.append("*");
>> return my_buffer.toString();
>> }
>> }
>>
>> //***********PB code*************
>> EJBConnection lEJBConn
>> MemoryLeak lj_ml
>> String value
>> int i
>>
>> If NOT IsValid(i_javavm) Then
>> i_javavm = CREATE JavaVM
>> i_javavm.CreateJavaVM("", False)
>> End if
>> lEJBConn = CREATE EJBConnection
>> lEJBConn.CreateJavaInstance(lj_ml, "MemoryLeak")
>> try
>> For i =0 to Dec(sle_count.text)
>> value = lj_ml.testmemoryleak( )
>> Next
>>
>> catch (Exception e)
>> MessageBox(" Other Exception", e.getMessage())
>> end try
>>
>>
>>
>>
>>
>


Vlad Zlotskiy Posted on 2004-09-15 22:05:53.0Z
From: "Vlad Zlotskiy" <vladz@imsi.com>
Newsgroups: sybase.public.powerbuilder.ejbclient
References: <413f840d$1@forums-2-dub> <4148748b$1@forums-1-dub> <mf6hk0laka89sp9p8tskd9q9r6vv8bqfl3@4ax.com>
Subject: Re: Memory leak for java proxy methods returning String
Lines: 79
Organization: IMS
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Original-NNTP-Posting-Host: exit.imsi.com
Message-ID: <4148be7b$1@forums-2-dub>
X-Original-Trace: 15 Sep 2004 15:13:15 -0700, exit.imsi.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 15 Sep 2004 14:53:43 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 15 Sep 2004 15:05:53 -0700
X-Trace: forums-1-dub 1095285953 10.22.108.75 (15 Sep 2004 15:05:53 -0700)
X-Original-Trace: 15 Sep 2004 15:05:53 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.ejbclient:367
Article PK: 424542

I've opened a case with Sybase : #11072214. They were able to reproduce the
problem. Hope it will get fixed soon, since PB to Java bridge was our
primary reason to upgrade to PB 9.

"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
news:mf6hk0laka89sp9p8tskd9q9r6vv8bqfl3@4ax.com...
> Well, your scenario seems straightforward enough. have you submitted
> the bug as Ben suggested? That's the mechanism to get it fixed.
>
> On 15 Sep 2004 09:57:47 -0700, "Vlad Zlotskiy" <vladz@imsi.com>
> wrote:
>
> >Does anyone from Sybase Team has comments on this ? The memory leak on
> >String result makes it impossible to use PB to Java interface.
> >
> >
> >"Vlad Zlotskiy" <vladz@imsi.com> wrote in message
> >news:413f840d$1@forums-2-dub...
> >> I have run into memory leak, when calling methods on Java proxy objects
> >> returning String from the java class. Looks like JVM does not garbage
> >> collect chunks of memory it returns to the calling PB thread. I read
from
> >> variuos JNI threads that it has something to do with the way native
app
> >> realeases memory on JVM calls. If it is not properly done jvm still
thinks
> >> that memory is being used and does not garbage collect it. Since
> >pbjvm90.dll
> >> is a black box, I have no way to verify it or control . I wonder if
> >anyone
> >> else experienced similar problems: I am running PB 9.01 Build 7204 with
> >PB9
> >> supplied jdk 1.4.
> >> I have used a simple java class that has method returning 2K String
with
> >PB
> >> calling it in a loop. I have used SysInternals process monitor to
observe
> >> the memory leak.
> >>
> >> //***********Java Code************
> >> public class MemoryLeak
> >> {
> >> public String testMemoryLeak() {
> >> StringBuffer my_buffer = new StringBuffer(2000);
> >> for (int i=0;i < 2000;i++) my_buffer.append("*");
> >> return my_buffer.toString();
> >> }
> >> }
> >>
> >> //***********PB code*************
> >> EJBConnection lEJBConn
> >> MemoryLeak lj_ml
> >> String value
> >> int i
> >>
> >> If NOT IsValid(i_javavm) Then
> >> i_javavm = CREATE JavaVM
> >> i_javavm.CreateJavaVM("", False)
> >> End if
> >> lEJBConn = CREATE EJBConnection
> >> lEJBConn.CreateJavaInstance(lj_ml, "MemoryLeak")
> >> try
> >> For i =0 to Dec(sle_count.text)
> >> value = lj_ml.testmemoryleak( )
> >> Next
> >>
> >> catch (Exception e)
> >> MessageBox(" Other Exception", e.getMessage())
> >> end try
> >>
> >>
> >>
> >>
> >>
> >
>