comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Is the Ada run-time required to detect out-of-memory conditions?
Date: Fri, 21 May 2004 14:58:46 -0500
Date: 2004-05-21T14:58:46-05:00	[thread overview]
Message-ID: <ssmdnX8G86LvwjPdRVn-gQ@megapath.net> (raw)
In-Reply-To: 5ad0dd8a.0405210313.70f9339d@posting.google.com

"Wojtek Narczynski" <wojtek@power.com.pl> wrote in message
news:5ad0dd8a.0405210313.70f9339d@posting.google.com...
...
> > The program allocates memory in an infinite loop using "new" and the
> > default storage pool, and of course exhausts all available storage.
> > The issue is whether or not Storage_Error should be raised.  With
> > GNAT, no exception is raised; instead the program receives SIGKILL
> > (not even SIGSEGV) from Linux.
>
> I noticed, that if the program allocates memory in 6Kb chunks or
> larger, Storate_Error is raised. If the chunk size is 5Kb or less, the
> program only prints "Killed". In between I have not tested.
>
> Also, shouldn't cases like this one, as a rule, eventually become part
> of ACATS?

There is such an ACATS test. The original version just tried to allocate
memory until it was exhausted. In our case, this caused virtual memory
target machines to thrash badly (there was about one allocated item per
page). We ended up limiting the amount of heap memory to 8 Meg in order to
make that test pass -- which really was in no one's interest. We discussed
the issues and concluded that tests that try to exhaust memory are
meaningless on virtual memory systems.

That version was replaced by a newer one that (A) allocates larger chunks of
memory; and (B) only tries to allocate a limited amount of memory before
giving up. That preserves the test for the embedded systems that it is
meaningful for, and prevents the need to do senseless things like limit the
amount of memory that you can allocate.

                    Randy.







  parent reply	other threads:[~2004-05-21 19:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20 22:54 Is the Ada run-time required to detect out-of-memory conditions? Ludovic Brenta
2004-05-21  0:44 ` Georg Bauhaus
2004-05-21  0:47 ` Stephen Leake
2004-05-21  0:54   ` Georg Bauhaus
2004-05-21  1:00     ` Stephen Leake
2004-05-21  3:29 ` Robert I. Eachus
2004-05-21  8:04 ` Vinzent 'Gadget' Hoefler
2004-05-21  9:34   ` Martin Krischik
2004-05-21 11:13 ` Wojtek Narczynski
2004-05-21 12:55   ` Martin Krischik
2004-05-21 16:00     ` Robert I. Eachus
2004-05-21 17:13       ` Ludovic Brenta
2004-05-21 23:41         ` Wojtek Narczynski
2004-05-23  8:20       ` Martin Krischik
2004-05-21 19:58   ` Randy Brukardt [this message]
2004-05-21 16:56 ` Mark H Johnson
2004-05-21 17:19   ` Ludovic Brenta
2004-05-21 21:39 ` user
2004-05-21 22:04   ` Ludovic Brenta
2004-05-21 22:11     ` Ludovic Brenta
2004-05-22 11:40       ` Simon Wright
2004-05-25 20:43     ` Is the Ada run-time required to detect out-of-memory Robert I. Eachus
2004-05-25 20:58       ` Duncan Sands
2004-05-25 21:19       ` Ludovic Brenta
2004-05-25 21:31         ` Duncan Sands
2004-05-26  7:09       ` Martin Krischik
2004-05-26  7:38         ` Duncan Sands
2004-05-26  8:16           ` Martin Krischik
2004-05-26  8:34             ` Duncan Sands
2004-05-26 16:20               ` Martin Krischik
2004-05-22 13:40   ` Is the Ada run-time required to detect out-of-memory conditions? Duncan Sands
2004-05-22 14:09     ` Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox