Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Large database generates out-of-memory message.

edited January 2002 in General
I am using RB 5.5 and Delphi 5 on w2k.

I have created a report that works fine on small and medium sized
databases, but when I try to run it on our cliens actual data (~200000
records) I get an error message saying it could not generate report
because it ran out of memory.

This happens a while after the Print method is called, and it does not
matter whether the output device is printer, file, or screen.
CachePages is false.

Is there anything I can do to get by this problem?

Thanks.

Comments

  • edited January 2002
    Try setting the Report.CacheManager.CacheType to ppCTFile at runtime.

    TppCacheManager.CachePath

    Run-time only. You should rarely, if ever, need to set this property.
    When
    a report is very long (over 1,000 pages), the report engine may switch
    to
    disk-based caching if it runs out of memory. In the event that this
    occurs,
    the value of this property indicates the directory to which the
    temporary
    caching files will be written.

    Defaults to the current windows path for temporary files.


    TppCacheManager.CacheType

    Run-time only. You should rarely, if ever, need to set this property.
    When
    a report is very long (over 1,000 pages), the report engine may switch
    to
    disk-based caching if it runs out of memory. In the event that this
    occurs,
    the value of this property indicates whether the caching has changed.
    Also,
    if for some reason you would like to force file caching, you can set
    this
    property to ppCTFile. The temporary caching files will be written to
    the
    directory specified in the CachePath property.



    Value Meaning
    ----------------------------
    ppCTFile Report engine caches to disk files.
    ppCTMemory Report engine caches to memory



    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Hmm, yep unfortuenately that makes no difference whatsoever. I guess the
    CacheType only has any effect if you actually Cache the pages, correct?

    However this "out of memory" error happens when the report is actually
    created. When I'm for example printing it to the screen I will see the
    first page, and at the bottom I see a counter saying "calculating report
    page XXX" it goes to around 2000 pages and then I get the out of memory
    message. Same thing happens when I try to print directly to a printer.

    Looking in the task manager it seems like each new page it loads takes
    up about 25k of new memory, so you can see that with a large report it
    will create problems quite fast.

    I also saw a message posted around the same time with my original post
    that had the out of memory error with rb version 6 so I see there is no
    use in trying to upgrade.

    Now, is this limitation a known problem or are these isolated occurances
    (i.e. can you reliably create reports with several thousands of pages).
    If it is a known proble, is a solutuion on the way, otherwise I guess
    it's back to, shudder, crystal :o(


  • edited January 2002
    When the pages are being generated, they exist in memory. Once all of the
    pages have been generated, then they are sent together as one print job.
    During generation, if the memory limit is reached, RB is supposed to write
    the pages to hard disk automatically. We'll have to retest this with some
    large reports.

    You are seeing the 'Calculating page: xxxx' because your Report.PassSetting
    is set to psTwoPass, and it will generate all of the pages, just to preview
    the first page.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    One question: Is there a big image (logo, background, etc.) on each page?

    Also, we have run reports here with tens of thousands of pages, but memoy
    usage all depends on what the report contains....

    -
    --
    Tom Ollar
    Digital Metaphors Corporation
  • edited January 2002
    Nope, there is only text on the report. All in the same font even.

  • edited January 2002
    Ok, I guess my name got killed, but that message was from me in case
    there is any confusion.

This discussion has been closed.