No announcement yet.

Memory Problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • Memory Problem


    I seem to be having memory problems in the midst of my programming. It's not a huge problem and I've seemingly (maybe misguidingly) found a solution; but, I'd like to know more.

    I've been creating a program called RPGSort. The purpose of RPGSort is to rename and sort all of the available RPG e-books whether they are fan-based or purchased from Wizards of the Coast. I've created a complex command-line driven program that'll examine every file found in the directory. I take the 32-bit CRC of the file, compare it against my database and if a match is found--sort it and rename it!

    The problem seems to be the database. If I compile the working code into an executable and run it with the full database, things work fine. If I execute the program from within the IDE with a full database, I get an Error 7 - Out of Memory. If I trim the database down, things will execute within the IDE.

    I am executing with "$ERROR ALL ON" and this appears to be the only outstanding error that baffles me--for the moment. Any thoughts?

    Don Ewald
    mailto:[email protected][email protected]</A>
    Donnie Ewald
    [email protected]

  • #2
    An ERROR 7 while running in the IDE... that would suggest that memory consumption is sufficiently high enough so that there is not enough memory to execute the code.

    Seriously, the IDE requires a fair amount of conventional memory in order to run.

    Assuming you have maximized the amount of conventional memory as much as possible (and provided the IDE with EMS & XMS memory), you have a few options available:

    1. Use the command-line debugger (PBD.EXE) instead of the IDE (PB.EXE)

    2. Reduce the amount of memory required for arrays, just while testing the code in the IDE (just as you indicate above).

    3. Use conditional compilation to exclude sections of code from the app, thus reducing the amount of memory required to run the code in the IDE.

    For example:
    %DEBUG = -1
      SUB Thatneedsalotofmemory(andlocalvars)
      END SUB
    I hope this helps!

    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    mailto:[email protected]