No announcement yet.

Out of main memory

  • Filter
  • Time
  • Show
Clear All
new posts

  • Out of main memory

    Fiddling around to see what the effect on EXE size would be if I removed all the "Unnecessary Macro Equates" from my code I encountered the "Out of main memory" message.

    A search on POFFS indicated that this is the result of running up against the limits of the 16-bit compiler. My app (An EXE of 50 000 lines of code with a DLL of 25 000 lines) must therefore be approaching this limit. Hence it might be necessary to plan for some restructuring in the not too distant future.

    The suggested solution was to break the code up into DLLs (somewhat reminiscent of having to break PBDOS programs into a series of chained modules). Passing many variables between DLLs and EXEs is a bit of a pain so I would be reluctant to go down this route unless and until absolutely necessary.

    I suppose I am wondering whether a 32-bit version of the compiler has ever been considered as a wish list item.

    The constant stream of wish lists that I receive myself has led to my own app growing like Topsy and landing me in this situation. I must admit to having become somewhat sensitised to arm waving clients requesting "a small new feature" unaware that the work they are suggesting would involve months of coding and testing and may in fact only be of benefit to a few people, I am therefore hesitant to suggest "improvements" to this excellent compiler when I am unaware of what is involved and the benefits to be expected.


    [This message has been edited by Bernard Chapman (edited December 20, 2000).]

  • #2
    I thought you could get away from this issue by simply separating the .BAS files into other files and using #INCLUDE on them???

    I had this issue once, In Dos you would use $SEGMENT, but I could be wrong about Windows...



    mailto:[email protected][email protected]</A>
    Scott Turchin
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi


    • #3
      I think Scott is right. I have a 300k PBCC exe made up of 20 or so .bas and .inc files and it compiles just fine.

      Don Dickinson


      • #4
        Breaking up the program into many include/header files is not going to solve
        the problem. As programs approach one megabyte, the PB/DLL compiler does one
        of two things(my observations)
        1. throws up a dialog saying out of main memory
        2. does a GPF but not before throwing up a dialog saying that an error
        occurred in your program - yea right!

        I use DLLs to break up large programs but this approach is not always feasible.
        My main hobby these days is staying ahead of the compiler and the two scenarios
        mentioned above. A 32bit compiler would be nice.

        Dominic Mitchell
        Dominic Mitchell
        Phoenix Visual Designer


        • #5
          "32-bit PowerBASIC compiler" is definitely on the wish list.

          Tom Hanlin
          PowerBASIC Staff