Groups | Search | Server Info | Login | Register
Groups > comp.os.os2.programmer.misc > #1912
| Subject | Re: limit |
|---|---|
| Newsgroups | comp.os.os2.programmer.misc |
| References | <usspco$12mfq$1@dont-email.me> <HypIN.507252$PuZ9.163533@fx11.iad> <ustilf$186hj$1@dont-email.me> |
| From | Dave Yeo <dave.r.yeo@gmail.com> |
| Message-ID | <iJuIN.572244$xHn7.47227@fx14.iad> (permalink) |
| Date | 2024-03-13 21:06 -0700 |
Paul Edwards wrote: > 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? I'd think 512M. It was all that was available until Warp v4.5 (earlier with Warp server) > > 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. Warp 4 (Warp 3?) has 64k granularity, older had 4k > > 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 There does seem to be other limits, perhaps just in the WPS. > > 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. mem /v at the command line will show aprox free mem. If you really want to explore memory allocations, and other interesting system level stuff, install Theseus, http://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/util/memory/Theseus_4-001.exe or ftp://service.boulder.ibm.com/ps/products/os2/fixes/v4.5warp/theseus4 Dave
Back to comp.os.os2.programmer.misc | Previous | Next — Previous in thread | Find similar
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