VOGONS

Common searches


Memory Use

Topic actions

First post, by Gene Wirchenko

User metadata
Rank Member
Rank
Member

This is a general question about memory use in DOSBox. I use DOSBox mainly to run a WordStar-style editor and a few utilities. I know that this is not the designed-for use.

I just tried to edit a file. The editor reported an out of memory error and would not load it. I thought that odd and tried another file which was even larger. That file loaded with no problem. I tried the first file again, and it failed again. Repeats did not help. I tried shutting down DOSBox and restarting it, and I was then able to load the first file.

What is going on?

I grant that it could be a bug in the editor.

When this situation happens (which is only occasionally), is there anything I can check in DOSBox?

I have been using DOSBox for many years, but I do not even know what I could check. Maybe, if DOSBox were not so reliable, I would already know how to do this. IME, DOSBox is a rather solid program.

Sincerely,

Gene Wirchenko

Reply 3 of 9, by BinaryDemon

User metadata
Rank Oldbie
Rank
Oldbie

Is there any chance the file you were trying to load was manipulated externally either by you or the host operating system (windows, linux, whatever your using)?

I think DOSBox assumes the files are not changing unless it's changing them, that's the whole reason for the shortcut:

CTRL-F4 Update cached information about mounted drives. Useful if you changed something on a mounted drive outside of DOSBox. Also cycles through disk images mounted using IMGMOUNT.

For instance if the file was 1024 bytes when DosBox was loaded and it was manipulated externally so that it was now 2048 bytes, I could see an application crashing because it's trying to load more data then it expected.

Check out DOSBox Distro:

https://sites.google.com/site/dosboxdistro/ [*]

a lightweight Linux distro (tinycore) which boots off a usb flash drive and goes straight to DOSBox.

Make your dos retrogaming experience portable!

Reply 4 of 9, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
BinaryDemon wrote:
Is there any chance the file you were trying to load was manipulated externally either by you or the host operating system (wind […]
Show full quote

Is there any chance the file you were trying to load was manipulated externally either by you or the host operating system (windows, linux, whatever your using)?

I think DOSBox assumes the files are not changing unless it's changing them, that's the whole reason for the shortcut:

CTRL-F4 Update cached information about mounted drives. Useful if you changed something on a mounted drive outside of DOSBox. Also cycles through disk images mounted using IMGMOUNT.

For instance if the file was 1024 bytes when DosBox was loaded and it was manipulated externally so that it was now 2048 bytes, I could see an application crashing because it's trying to load more data then it expected.

Good ideas. I have been caught occasionally by having a file open outside of DOSBox or by the mounted drive cache being out of date, but it was not the case here. The file was one that I have not referred to in months either inside or outside of DOSBox.

This problem has happened before, but it is very infrequent.

Sincerely,

Gene Wirchenko

Reply 5 of 9, by JosSchaars

User metadata
Rank Newbie
Rank
Newbie

DOSBox caches file operations, its internals don’t have to match the actual data. If you have another program, DOS or Windows, accessing the same data, you have to expect file corruption. Especially database programs are vulnerable. No DOSBox mod was proven to fix this due to that caching of file operations. If you have a multi-user DOS program: Do not use DOSBox!

Reply 6 of 9, by Malik

User metadata
Rank l33t
Rank
l33t

Some times, too much available memory can produce unpredictable results with older software. Try limiting the available memory. Try disabling extended memory or expanded memory or both or reduce their size to 4 or 2MB.

Try disabling UMB.

Or try loading some TSRs like a ramdisk to limit available memory.

5476332566_7480a12517_t.jpgSB Dos Drivers

Reply 7 of 9, by bruenor41

User metadata
Rank Newbie
Rank
Newbie

Question is how much is the "file operation cache useful". I think programs know own files and dont need this cache. File managers running in dosbox probably create own cache. Would be cool have it on flag in dosbox config

Reply 8 of 9, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
JosSchaars wrote:

DOSBox caches file operations, its internals don’t have to match the actual data. If you have another program, DOS or Windows, accessing the same data, you have to expect file corruption. Especially database programs are vulnerable. No DOSBox mod was proven to fix this due to that caching of file operations. If you have a multi-user DOS program: Do not use DOSBox!

It is empatically not a case of another program accessing the data. I had not used the file in months except for compiling it as part of its system. That was not occurring at the time.

The editor is not multi-user.

This is a glitch that occurs occasionally. I have never been able to figure out why. Restarting DOSBox always makes the problem go away. I was hoping to be able to do better than that.

Sincerely,

Gene Wirchenko

Reply 9 of 9, by Gene Wirchenko

User metadata
Rank Member
Rank
Member

Another clue.

I just renamed a file outside of DOSBox. I then tried to access the file (using the new name) and got the out-of-memory error from my editor. I tried refreshing the directory cache and tried again. This time it worked.

I did copy another file to the old name. I did not think at the time whether that was connected to the issue.

If I try to open a file that does not exist, I simply get an empty file to work with, so something is off with the out-of-memory cases.

Sincerely,

Gene Wirchenko