More memory for compiler and FASM

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

More memory for compiler and FASM

Post 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.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: More memory for compiler and FASM

Post 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.
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: More memory for compiler and FASM

Post 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.
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: More memory for compiler and FASM

Post 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!
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: More memory for compiler and FASM

Post 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?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: More memory for compiler and FASM

Post by Fred »

Should be possible to raise dynamically the limit, i will take a look.
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: More memory for compiler and FASM

Post by Seymour Clufley »

Thanks, Fred. :)
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: More memory for compiler and FASM

Post 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!
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: More memory for compiler and FASM

Post 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.
Zach
Addict
Addict
Posts: 1675
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: More memory for compiler and FASM

Post 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.
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: More memory for compiler and FASM

Post 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.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: More memory for compiler and FASM

Post by Fred »

Feel free to send me your project for testing purpose, the compiler shouldn't crash, 125k lines isn't that big.
Post Reply