From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ab4f67f984ef04f9 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Is the Ada run-time required to detect out-of-memory conditions? Date: Sun, 23 May 2004 10:20:24 +0200 Organization: AdaCL Message-ID: <3786783.CRZ4Sa361O@linux1.krischik.com> References: <878yfmiuak.fsf@insalien.org> <5ad0dd8a.0405210313.70f9339d@posting.google.com> <1486434.Nr7pvG7a0e@linux1.krischik.com> <3YmdnQbGo7stujPd4p2dnA@comcast.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1085300433 06 15140 ZOx5Gup1C72jyxf 040523 08:20:33 X-Complaints-To: usenet-abuse@t-online.de X-ID: SXz4wBZXwe7o7esHl8QmVN0BK40SwpsB+a6Eazt3jsb7FKEV25M2ZQ User-Agent: KNode/0.7.7 Xref: controlnews3.google.com comp.lang.ada:785 Date: 2004-05-23T10:20:24+02:00 List-Id: Robert I. Eachus wrote: > Martin Krischik wrote: > >> Just a thought: The page size on Intel CPU's is 4 kb. So most OS's on >> Intel CPU will only handle mguarantyequests of at least one page. >> >> I find it interesting that with request significantly larger then one >> page everything seems Ok. >> >> Lets Think: With GNAT allocation from the standart storrage pool are just >> passed down to C's malloc (). >> >> When smaller memory is requested most C compiler will bundele several >> requests into one page request. >> >> When larger memory is requested some C compiler will just pass the >> request on to the OS and some other will allways bundle. > > This is interesting. It sounds like almost the opposite of what I > expected. Apparently if the memory requests are large enough that some > pages are left virtual, you get the Storage_Error. But if the code > results in every page allocated being 'touched' you get killed. Of corse when you read http://gee.cs.oswego.edu/dl/html/malloc.html you will see that the OS service of dynamic memory on Unix is rather primitive - compared to Windows OS/2 and such like. The principle as I described it still holds however on Unix the program append new memory to the end and will almost never be able to return memory to the OS. Unlike Windows OS/2 where a you can free an unused pages with (Dos)FreeMem. Of corse I don't know if a particular free () implementation actually searches for unused pages. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com