Groups | Search | Server Info | Login | Register


Groups > comp.os.os2.programmer.misc > #1910

Re: limit

From Paul Edwards <mutazilah@gmail.com>
Newsgroups comp.os.os2.programmer.misc
Subject Re: limit
Date 2024-03-14 09:07 +0800
Organization A noiseless patient Spider
Message-ID <ustilf$186hj$1@dont-email.me> (permalink)
References <usspco$12mfq$1@dont-email.me> <HypIN.507252$PuZ9.163533@fx11.iad>

Show all headers | View raw


On 14/03/24 06:13, Dave Yeo wrote:

>> I see that DS has a limit of 5fff ffff which is basically 1.5 GB.
>>
>> But I thought without OBJ_ANY I got 512 MiB max, and
>> with OBJ_ANY I could potentially access 4 GiB.
>>
>> So where is that limit coming from?
>
> What is your VIRTUALADDRESSLIMIT in config.sys set to? ArcaOS defaults
> to 1536 or similar, maximum is 3072 though some hardware doesn't like
> that as it can interfere with PCI space, eg video memory. Should be a
> number that ends in 00 in hex.

Thanks for that - spot on!

[C:\]grep VIR config.sys
VIRTUALADDRESSLIMIT=1536


Next issue.

I was surprised to be running out of memory
when doing this:

[P:\devel\gcc\gcc\xxx]type temp.cmd
\dos\pdas --oformat coff -o c-common.o c-common.s
[P:\devel\gcc\gcc\xxx]


When I added the "requesting" debug I got this:

requesting 32 bytes, total 636279, attempts 7394
requesting 44 bytes, total 636323, attempts 7395
requesting 44 bytes, total 636367, attempts 7396
stdlib reports alloc failure
\dos\pdas: error: memory full (malloc)

But without the debug, I didn't get that "alloc failure"
message. Instead I got an OS/2 popup saying I was short
of unspecified resources.

Now I thought there was a limit of 512 MB by default,
but there is an actual OBJ_TILE flag to DosAllocMem
to restrict it to that it seems.

And a different flag for OBJ_ANY.

Which means the default is what?

Now I know it is not ideal to call DosAllocMem for
every memory allocation requested and I should use
a heap manager (I actually have one (memmgr), but I
prefer not to use it, for simplicity).

Even with 4k granularity, there are less than 8000
requests, so that's 32 MB additional overhead, on
top of ... less than 1 MB.

So I suspect there is a limit of around 8000 separate
requests. I'm guessing this is to keep within the
limit of 80386 selectors so that someone may
request this memory to be converted to 16:16

Anyway, adding OBJ_ANY allowed the memory requests
to continue:

requesting 6152 bytes, total 849766, attempts 10683
requesting 40 bytes, total 849806, attempts 10684
requesting 40 bytes, total 849846, attempts 10685
requesting 40 bytes, total 849886, attempts 10686


And I didn't experience any issues with DosWrite
etc either.

 From memory it is DosOpen that has the issue, not
DosWrite. And so long as my executable is loaded
below 512 MiB - which is under OS/2 control - I
shouldn't have any issue with parameters to
DosOpen being above the 512 MiB line.

Well - the second parameter could potentially be
in high memory, but that would be an unlikely,
but I guess not impossible, thing to be internally
mapped to 16:16.

rc = DosOpen((PSZ)fnm,
              &myfile->hfile,
              &action,
              newsize,
              fileAttr,
              openAction,
              openMode,
              (ULONG)0);

But for now, it works, and with this problem fixed
or circumvented, I should be up and running soon.

BFN. Paul.

Back to comp.os.os2.programmer.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

limit Paul Edwards <mutazilah@gmail.com> - 2024-03-14 01:56 +0800
  Re: limit Dave Yeo <dave.r.yeo@gmail.com> - 2024-03-13 15:13 -0700
    Re: limit Paul Edwards <mutazilah@gmail.com> - 2024-03-14 09:07 +0800
      Re: limit Paul Edwards <mutazilah@gmail.com> - 2024-03-14 11:53 +0800
        Re: limit "Andi B." <andi.b@gmx.net> - 2024-03-14 10:53 +0100
      Re: limit Dave Yeo <dave.r.yeo@gmail.com> - 2024-03-13 21:06 -0700

csiph-web