Page 1 of 1

More memory for compiler and FASM

Posted: Tue Nov 29, 2011 5:55 pm
by Seymour Clufley
As can be seen in this thread and this thread, there seems to be a bug with large source codes in that PB doesn't pass enough memory to its own compiler, or to FASM, to deal with. One or the other crashes as a result.

I'm currently getting round this by deleting and merging procedures and getting rid of macros, but it is making my code rather messy.

Surely it would be easy to fix this?

For FASM, you could have a project setting - "Run FASM with ?KB memory" - and people could increase the amount until FASM worked. Or just have PB estimate the memory needed.

For the PB compiler error, same solution. Can the needed memory be estimated? Or just allow people to set the amount of memory it gets, until it works.

Re: More memory for compiler and FASM

Posted: Tue Nov 29, 2011 8:24 pm
by Danilo
Why can't FASM and PB just use all available memory like any other program?
The 32bit versions should be able to use 2GB if you have "so much" :D memory in your PC.
I can not believe they hardcoded a limit for memory use.

Re: More memory for compiler and FASM

Posted: Wed Nov 30, 2011 1:28 am
by ozzie
I agree, and thanks for your assistance, Seymour. Hopefully the matter is already being considered because I note that Rings moved this thread to the bugs section. A permanent fix to this issue would be desirable because until it is fixed I presume we will need to redo the work-around each time we install a new version of PB.

Re: More memory for compiler and FASM

Posted: Wed Nov 30, 2011 2:11 am
by Zach
I wasn't even aware this was a problem... I don't know if I'll ever produce a HUGE project, but I hope this gets resolved either way!

Re: More memory for compiler and FASM

Posted: Thu Dec 01, 2011 6:37 pm
by Seymour Clufley
It would be good to hear from Fred or Freak about this. Surely this would be an easy thing to add for v4.61?

Re: More memory for compiler and FASM

Posted: Thu Dec 01, 2011 6:39 pm
by Fred
Should be possible to raise dynamically the limit, i will take a look.

Re: More memory for compiler and FASM

Posted: Fri Dec 02, 2011 2:29 pm
by Seymour Clufley
Thanks, Fred. :)

Re: More memory for compiler and FASM

Posted: Fri Dec 02, 2011 9:56 pm
by Seymour Clufley
I just had to cut the project down again. I'm not sure how much more I can cut it.

The strange thing is, I was using Danilo's patch and the compiler still crashed. So maybe it isn't a memory issue.

I'm getting worried about this. This is a project I've been developing for nearly 3 years and it would be a disaster if I had to rewrite it in another language. 125k lines!

Re: More memory for compiler and FASM

Posted: Sat Dec 03, 2011 8:33 am
by ozzie
Is it feasible to move some of your code into a DLL? That's an approach I considered but fortunately have not yet had to do so.

Re: More memory for compiler and FASM

Posted: Sat Dec 03, 2011 6:12 pm
by Zach
I was just thinking the same.. Surely as you have developed you've tried to compartmentalize code a little bit, based on what it does?
It might be easier to just take some of your more narrow-scope source and compile it as a DLL, then include it in the project that way.

Re: More memory for compiler and FASM

Posted: Sat Dec 03, 2011 8:22 pm
by Seymour Clufley
Yes, of course it's possible to split it up into DLLs, but that would be messy. It may have to be done, I realise that.

I'm thinking of taking out all the SVG/graphics stuff and making a dedicated graphics DLL which would perform tasks when required by the main program. That would be a tidy way to split things up. I'm not sure how much breathing space it would create, though - hopefully enough to keep me going until we get this dynamic memory.

Re: More memory for compiler and FASM

Posted: Mon Dec 05, 2011 3:42 pm
by Fred
Feel free to send me your project for testing purpose, the compiler shouldn't crash, 125k lines isn't that big.