Jump to content
Excelsior Forums
Sign in to follow this  
excbv

Out of heapspace error

Recommended Posts

Hello,

I use X86 Native XDS compiler for Windows ver. 2.51, and I am running into the following problem:

I have a huge case statement with 311 cases. When I compile the program, the compiler spends a lot of time optimizing, and finally issues the message "unhandled exception #18" (out of heap space). I tried the following things:

1.  set NOOPTIMIZE to +

2.  change COMPILERHEAP from 0 to a huge value (40000000)

3.  break down the case statement into smaller ones (with about 64 cases)

None of these things work. Can anybody suggest some additional things to try?

Regards,

excbv

Share this post


Link to post
Share on other sites

Can you create and post a minimal project to reproduce the problem?

Did you try IF-ELSIF chain? Did you try introducing local or global procedures to separate the code?

Share this post


Link to post
Share on other sites

Hello,

Thanks for replying. I finally made my program to work by subdividing the large case statement into smaller ones _and_ enclosing the smaller case statements into separate procedures (if I simply decompose the case into two levels consisting of smaller case statements, I still get the out of heapspace error). After subdividing into separate procedures, the procedures may be selected by a case statement, like so:

          CASE i DIV 32 OF

          0:  CASE0

      |  1:  CASE1

      |  2:  CASE2

          .....

          END

where CASEj looks like this:

PROCEDURE CASEj;

  BEGIN

    CASE i OF

    32*j+0 ...

    32*j+1 ...

    ....      ...

    32*j+31 ...

    END

  END

As you suggest I will try to construct a minimal program exhibitting the described problem, and post it here.

Regards,

excbv

Share this post


Link to post
Share on other sites

Hello,

I have managed to pare down my program (by the way, it is an Oberon language LALR parser) by removing most content while not eliminating the error that is being discussed. I made a zip file out of all components, and if the project file is run, the error should appear. I notice that zip is not an allowable file type for attaching; therefore, I changed the extension to .doc; I hope it works.

Regards,

excbv

HeapspaceProblem.doc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×