FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Memory Leak????
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Memory Leak????
Posted: Fri Oct 29, 2010 09:24 PM
Hi,

In my program I display some data (graphically) and allow the user to "Page" through the data.
This all worked perfectly until I added some IF/ELSE/ENDIF statements.

The strange thing is the IF/ELSE statements only changed some numeric values. But now I am getting what I think is a memory leak.

The statements I added are similar to this:
Code (fw): Select all Collapse
IF nGraphSize = 0
   Rectangle(oDlgGraph:hDc, 185,xx,395,xx+1,hPenSpo2)
ELSE
   Rectangle(oDlgGraph:hDc, 335,xx,395,xx+1,hPenSpo2)
ENDIF


Basically if nGraphSize = 0 it uses all the original values (from when I did not have the problem).

I am at a loss as to why this is happening.

This is what the screen should look like:



This is what happens after the user has "paged" through the data:



I can't really provide a self contained sample of code that will show this.

Can someone PLEASE point me in the right direction. :-)
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Memory Leak????
Posted: Fri Oct 29, 2010 10:19 PM

Jeff,

Why do you think it is a memory issue? Have you checked it before and after?

Try changing the 335 to the original value (185) and leaving the IF/ELSE as is. If this works as it used to then try chaning the value to 186, then 187, etc until the problem starts.

It 335 a location off the chart maybe?

Maybe the XX value is getting changed when it shouldn't be?

Just some random ideas.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Memory Leak????
Posted: Fri Oct 29, 2010 11:12 PM
Hi James,

Thanks for the ideas....

The value of nGraphSize in stored in an ini file that get loaded at the start of the program.
If I leave it at 0 I still get the problem (at this point is should act as it was before I added the new code).

I'm thinking it's a memory problem because I can page through about 75% of the data (a large array containing a data point every 4 seconds for about 11 hours) ... if I rem out the part that draws the actual data lines the problem is not there.
The way the gray shaded areas are turned black, the missing text on the screen and the way the buttons are not redrawn correctly all make me think there is something going on with memory.

Also, the position bar for some reason is redrawn at the top of the screen .... nothing was changed that would affect the position bar.

This is compiled with the older FWH 7.11 ... I thought maybe recompiling with 10.9 would help but as you can see from my other post I'm having issues there too. http://forums.fivetechsupport.com/viewtopic.php?f=3&t=20159
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Memory Leak????
Posted: Sat Oct 30, 2010 12:25 AM

I have recompiled with the 10.9 FWH ... Still having the problem. RATS !!!!!!!

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: Memory Leak????
Posted: Sat Oct 30, 2010 12:51 AM

Try to run your application into display card PC( not on board ).

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Memory Leak????
Posted: Sat Oct 30, 2010 01:07 AM

My PC uses a high end video card. I am also able to reproduce the problem on my laptop.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Memory Leak????
Posted: Sat Oct 30, 2010 06:08 AM
Jeff,

Please place these calls in your code:
Code (fw): Select all Collapse
IF nGraphSize = 0
   Rectangle(oDlgGraph:hDc, 185,xx,395,xx+1,hPenSpo2)
   LogFile( "info.txt", { 185, xx, 395, xx+1 } )
ELSE
   Rectangle(oDlgGraph:hDc, 335,xx,395,xx+1,hPenSpo2)
   LogFile( "info.txt", { 335, xx, 395, xx+1 } )
ENDIF

and copy here the values that you get in file.txt for those sections that fail
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Memory Leak????
Posted: Sat Oct 30, 2010 01:49 PM
I figured it out :-)

It was a poorly used ".and." that messed everything up.

I had done something like this:
Code (fw): Select all Collapse
IF nRow > 275 .and. nGraphSize = 0


Where it should have been:
Code (fw): Select all Collapse
IF nGRaphSize = 0
   IF nRow > 275


Thanks to all for your help.
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion