VOGONS


First post, by dorrepaalm

User metadata
Rank Newbie
Rank
Newbie

When compiling a program using Borland Pascal the memory usage increases dramatically (from 60MB at start till 600MB end of compilation).
Sounds like a memory leak to me. The compilation speed is also very poor.
Any solutions?

Reply 1 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

try core=normal instead of auto.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 9, by dorrepaalm

User metadata
Rank Newbie
Rank
Newbie

Makes no difference...

Reply 3 of 9, by neozeed

User metadata
Rank Newbie
Rank
Newbie

I kind of 'found' the answer to this, I was having big problems with this too (a good day of running a program that keeps shelling out and I was ~1.5GB of ram in use!!!) Anyways it's the directory cache!!!!

Memory usage while compiling with Borland Pascal
There is a hint on this problem here...

It would seem that mingw's gcc on windows leaks like crazy....

in the file /include/dos_system.h

Change

#define MAX_OPENDIRS 2048
to
#define MAX_OPENDIRS 2

You can't completely disable it this way, and yeah it'll keep on leaking memory, but it's FAR less then before.. One insane build program would leak about 200-300MB in a minute, and now I'm leaking 17MB of ram in the same operation.....

I'm on Vista x64, gcc version 3.4.5 (mingw-vista special r3)

Reply 4 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

do you have some set of sample files to reproduce the problem ?

Water flows down the stream
How to ask questions the smart way!

Reply 5 of 9, by neozeed

User metadata
Rank Newbie
Rank
Newbie

sure, let me cook something up....

Reply 6 of 9, by neozeed

User metadata
Rank Newbie
Rank
Newbie

basically just keep running any compiler over & over.....

like this exciting program...

void main(){}

bcc x.c

re-run this a few times, and you'll see memory starting to increase.... the more complicated build steps (ie more headers, and anything pharlap involved since it's got so many step) you'll see it adding more memory...

I could have sworn I ran clipper 5.3 on this earlier and the exospace linker (it's pharlap 286...) would make it go nuts.... even simple programs like

? "hi"

Reply 7 of 9, by neozeed

User metadata
Rank Newbie
Rank
Newbie

I dont know if it matters that much, but that causeway linker & extender doesn't cause dosbox to leak...... Let me try MSC 5

----

edit MSC 5.1 doesn't explode out.... didn't the old borland 3.x stuff run in protected mode...? I vaugely recall something like that...

I wonder if it's programs that open & close files like wild in PM cause the issue.....

I'll have to test something further.

-----

What is interesting is that eventually, depending on the OS, it'll over commit, and then the memory usage will drop down to 5-9MB!!!!!

I wonder if it's easy to outright remove all the file/directory cache?

Reply 8 of 9, by robertmo

User metadata
Rank l33t++
Rank
l33t++

by the way, your link links to this thread

Reply 9 of 9, by neozeed

User metadata
Rank Newbie
Rank
Newbie
robertmo wrote:

by the way, your link links to this thread

oops how did I manage that?!

DOSBox memory leak (use all my ram 'till it dies)

Thats the ancient thread...

with the quote of

No, but maybe it's something with the file caching. It's hard to do any real testing as the problem seems to be build-specific. […]
Show full quote

No, but maybe it's something with the file caching. It's hard to do any
real testing as the problem seems to be build-specific. You could go
through the cvs builds thread on the dev forum to see if any of those
works.

From someone named wd wd