[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Invalid heap space using HTTPAPI



Thanks for finally sending some almost useful information!

Make only one change a time and test so we know what eventually cures the patient.

You are running an old version. You really should be able to run this (especially in a test environment) with the latest version. As has been pointed out, backwards compatibility is very good. At least run a test WS.CONTACT with the new version so that we know it is a current problem. Download the Beta and install into a different library. Compile and run using the new version.

>From limited experience, changing ptr between alloc and dealloc will cause a problem. If that happens, why? 

Did you dump the program? Program dump listing? Not sure it would help, but can't hurt when debugging. What is the value of "ptr"?

Is there a pointer declared in your module WS.CONTACT called "ptr"? Are you using it? I don't think it needs to be there. If not, please delete and retry test.

Add some debugging output...print the ptr value at the point where it allocates memory. Print it just before the dealloc. The pointer should be the same. Here is an article that talks about one way to print a pointer http://www.itjungle.com/fhg/fhg110310-story02.html. HTTPAPI is full of pointers and uses arrays of pointers in some places. 

If you run this for the record at 176,677, do you get the error?
 
If you read the first 1000 records without calling getContactInfo, then let it run, do you get the error at 177,677? In other words, does it always crash after running 176,677 iterations regardless of the data you reading? Or at least within a few records of that?

If you watch the program running, do you notice anything unusual? Stack growing? Files growing?

Good of you to send a compile listing for the code so we can see the file layouts and other copied information...if want us to try to recreate, we also need just the source without the other stuff and maybe just a bit of knowledge on how to fake it. But try the new version, try the ptr removal, try printing the ptr. Let's see how far we get.

 
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Julio Cabrera
> Sent: Thursday, February 17, 2011 11:00 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: RE: Invalid heap space using HTTPAPI
> 
> Charles:
> 
> 
> 
> After a while trying to reproduce the error, I wrote a program
> (TSTCONTACT) that reads our member file with almost 5 million records
> in
> a loop and call my program getContactInfo. After 176,677 records, it
> gives the heap memory error:
> 
> 
> 
> 
> 
> The error happens in the dealloc line (3448):
> 
> 
> 
> Program:   HTTPAPIR4      Library:   LIBHTTP        Module:
> HTTPUTILR4
> 
> 
>    3444       3443 D xdealloc        PI
> 
> 
>    3445       3444 D   ptr                           *
> 
> 
>    3446       3445  /if defined(TERASPACE)
> 
> 
>    3447       3446  /else
> 
> 
>    3448       3447 C                   dealloc                 ptr
> 
> 
>    3449       3448  /endif
> 
> 
>    3450       3449 C                   eval      ptr = *null
> 
> 
>    3451       3450 P                 E
> 
> 
>    3452       3451
> 
> 
>    3453       3452
> 
> 
>    3454       3453
> *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
>    3455       3454  * xrealloc(): re-allocate memory
> 
> 
>    3456       3455
> *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
>    3457       3456 P xrealloc        B                   export
> 
> 
>    3458       3457 D xrealloc        PI              *
> 
> 
> 
> 
> The http_debug was *ON
> 
> I include here the source of the Test program, The source of the RPG to
> consume the Web Service and the txt of the debug.
> 
> I still do not have any clue of what happened.
> 
> I will appreciate if you can give me any idea.
> 
> 
> 
> Thank you very much,
> 
> 
> 
> 
> 
> JULIO C. CABRERA
> 
> Sr. Programmer Analyst, Information Technology
> 
> Interval International
> 
> 6262 Sunset Drive * Miami, Florida 33143
> 
> 305.666.1861, ext. 7287 * direct 305.925.7287
> 
> cell 305.928.7925* fax 305.668.3409
> 
> Julio.Cabrera@xxxxxxxxxxxxxxxx
> 
> 
> 
> IntervalWorld.com * ResortDeveloper.com
> 
> 
> 
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Charles
> Wilt
> Sent: Friday, January 21, 2011 3:02 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: Invalid heap space using HTTPAPI
> 
> 
> 
> Julio,
> 
> 
> 
> Turn debug logging on and post the resulting log..
> 
> 
> 
> http_debug(*ON);
> 
> 
> 
> Charles
> 
> 
> 
> On Fri, Jan 21, 2011 at 2:42 PM, Julio Cabrera
> 
> <Julio.Cabrera@xxxxxxxxxxxxxxxx> wrote:
> 
> >
> 
> >
> 
> >   Gentlemen:
> 
> >
> 
> >
> 
> >   I need help with this error.
> 
> >
> 
> >   It is happening with an RPG service using HTTPAPI, and normally
> 
> >   happens when the web service is called multiple times.
> 
> >
> 
> >
> 
> >   [cid:image002.jpg@01CBB979.7E576830]
> 
> >
> 
> >
> 
> >   Any help will be very appreciated.
> 
> >
> 
> >
> 
> >   Thanks,
> 
> >
> 
> >
> 
> >
> 
> >   JULIO C. CABRERA
> 
> >
> 
> >   Sr. Programmer Analyst, Information Technology
> 
> >
> 
> >   Interval International
> 
> >
> 
> >   6262 Sunset Drive o Miami, Florida 33143
> 
> >
> 
> >   305.666.1861, ext. 7287 o direct 305.925.7287
> 
> >
> 
> >   cell 305.928.7925 o fax 305.668.3409
> 
> >
> 
> >   [1]Julio.Cabrera@xxxxxxxxxxxxxxxx
> 
> >
> 
> >
> 
> >   IntervalWorld.com o ResortDeveloper.com
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> ______________________________________________________________________
> 
> >   _______
> 
> >   Scanned by IBM Email Security Management Services powered by
> 
> >   MessageLabs. For more information please visit
> http://www.ers.ibm.com
> 
> >
> ______________________________________________________________________
> 
> >   _______
> 
> >
> 
> > References
> 
> >
> 
> >   1. mailto:Julio.Cabrera@xxxxxxxxxxxxxxxx
> 
> >
> 
> >
> -----------------------------------------------------------------------
> 
> > This is the FTPAPI mailing list.  To unsubscribe, please go to:
> 
> > http://www.scottklement.com/mailman/listinfo/ftpapi
> 
> >
> -----------------------------------------------------------------------
> 
> >
> 
> >
> 
> -----------------------------------------------------------------------
> 
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> 
> http://www.scottklement.com/mailman/listinfo/ftpapi
> 
> -----------------------------------------------------------------------
> 
> 
> 
> _______________________________________________________________________
> _
> _____
> 
> Scanned by IBM Email Security Management Services powered by
> MessageLabs.
> 
> _______________________________________________________________________
> _
> _____
> 
> 
> _______________________________________________________________________
> ______
> Scanned by IBM Email Security Management Services powered by
> MessageLabs. For more information please visit http://www.ers.ibm.com
> _______________________________________________________________________
> ______
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------