comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: The future of Spark . Spark 2014 : a wreckage
Date: Thu, 11 Jul 2013 18:11:35 -0500
Date: 2013-07-11T18:11:35-05:00	[thread overview]
Message-ID: <krne37$kob$1@loke.gir.dk> (raw)
In-Reply-To: lyppupvcs3.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyppupvcs3.fsf@pushface.org...
> "Randy Brukardt" <randy@rrsoftware.com> writes:
>
>> problems with fragmentation. (Although those are way overblown,
>> they're very unlikely to occur in practice.)
>
> That depends on the capabilities of your OS's memory manager! In our
> VxWorks 5.5/Ada 95 system, it didn't take long for the heap to become so
> fragmented that the system couldn't meet real-time constraints (such as
> failing to kick the watchdog timer).

I suppose I should know better than to presume most programmers are 
competent. ;-)

My personal experience is that fragmentation is rare at best. We had a bit 
of trouble with it in our MS-DOS compilers, that mainly came from allocating 
lots of objects, each one slightly larger than the last (pretty much the 
worst case for heap use). Changing to a quadradic size increase (rather than 
a linear one) got rid of that problem (as did moving some tiny objects to 
their own manager [allocated once and never freed back to the main heap] - 
today I'd use a custom pool for that).

I was very worried that the long running web server and spam filter would 
suffer from fragmentation, but I've never seen any evidence of that, even 
after running two months and having processed a half a million requests. 
Apparently, the Windows heap manager is smart enough to prevent it, as the 
fragmentation goes up a bit in the first few hours after the servers get 
started and then stays pretty constant after that.

> It was a fairly straightforward job to provide our own version of GNAT's
> System.Memory to use preallocated binary-sized bins (we instrumented it
> to determine the maximum number of blocks for each bin and allocated
> that number at startup, with the ability to allocate further blocks at
> run time if the measured maximum requirement grew).
>
> I don't remember why use of Ada storage pools wasn't the right solution;
> maybe the some of the allocations were by the runtime without the option
> to use a user-defined storage pool? (things like task control blocks).

Obviously, the best solution is to replace a bad heap by a good one. Won't 
work in every circumstance, but it will in 98% of them.

                          Randy. 


  reply	other threads:[~2013-07-11 23:11 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 17:56 The future of Spark . Spark 2014 : a wreckage vincent.diemunsch
2013-07-08 19:24 ` Simon Wright
2013-07-08 20:59 ` Florian Weimer
2013-07-09  7:40   ` Dmitry A. Kazakov
2013-07-09  8:30     ` Georg Bauhaus
2013-07-09  8:58       ` Dmitry A. Kazakov
2013-07-09 10:27         ` G.B.
2013-07-09 11:13         ` G.B.
2013-07-09 15:14     ` Adam Beneschan
2013-07-09 22:51     ` Robert A Duff
2013-07-10  7:49       ` Dmitry A. Kazakov
2013-07-10  8:21         ` Georg Bauhaus
2013-07-08 21:32 ` Randy Brukardt
2013-07-09  7:28   ` Dmitry A. Kazakov
2013-07-09 11:29     ` Simon Wright
2013-07-09 12:22       ` Dmitry A. Kazakov
2013-07-09 20:37     ` Randy Brukardt
2013-07-10 10:03       ` Dmitry A. Kazakov
2013-07-10 23:21         ` Randy Brukardt
2013-07-11  7:44           ` Dmitry A. Kazakov
2013-07-11 22:28             ` Randy Brukardt
2013-07-12  8:02               ` Dmitry A. Kazakov
2013-07-12 21:16                 ` Randy Brukardt
2013-07-14 10:19                   ` Dmitry A. Kazakov
2013-07-14 15:57                     ` Georg Bauhaus
2013-07-16  0:16                       ` Randy Brukardt
2013-07-17  1:30                         ` Shark8
2013-07-17 23:08                           ` Randy Brukardt
2013-07-18  7:19                             ` Dmitry A. Kazakov
2013-07-19  4:36                               ` Randy Brukardt
2013-07-16  0:13                     ` Randy Brukardt
2013-07-16  8:37                       ` Dmitry A. Kazakov
2013-07-16 22:13                         ` Randy Brukardt
2013-07-17  7:59                           ` Dmitry A. Kazakov
2013-07-17 23:26                             ` Randy Brukardt
2013-07-18  7:37                               ` Dmitry A. Kazakov
2013-07-19  4:32                                 ` Randy Brukardt
2013-07-19  7:16                                   ` Dmitry A. Kazakov
2013-07-20  5:32                                     ` Randy Brukardt
2013-07-20  9:06                                       ` Dmitry A. Kazakov
2013-07-12  1:01           ` Slow? Ada?? Bill Findlay
2013-07-09  7:57   ` The future of Spark . Spark 2014 : a wreckage Stefan.Lucks
2013-07-09 20:46     ` Randy Brukardt
2013-07-10  8:03       ` Stefan.Lucks
2013-07-10 12:46         ` Simon Wright
2013-07-10 23:10         ` Randy Brukardt
2013-07-11 19:23           ` Stefan.Lucks
2013-07-12  0:21             ` Randy Brukardt
2013-07-12  9:12               ` Stefan.Lucks
2013-07-12 20:47                 ` Randy Brukardt
2013-08-05  5:43                 ` Paul Rubin
2013-07-10 12:19   ` vincent.diemunsch
2013-07-10 16:02     ` Simon Wright
2013-07-11  0:36     ` Randy Brukardt
2013-07-11  6:19       ` Simon Wright
2013-07-11 23:11         ` Randy Brukardt [this message]
2013-07-11 10:10       ` vincent.diemunsch
2013-07-11 14:23         ` Dmitry A. Kazakov
2013-07-12  0:07           ` Randy Brukardt
2013-07-12  0:00         ` Randy Brukardt
2013-07-12  7:25           ` Simon Wright
2013-07-12 20:07             ` Randy Brukardt
2013-07-12 14:23           ` Robert A Duff
2013-07-12 20:14             ` Randy Brukardt
2013-07-11 23:50       ` Shark8
2013-07-08 23:18 ` Peter C. Chapin
2013-07-09  7:34   ` Stefan.Lucks
2013-07-09 15:21     ` Adam Beneschan
replies disabled

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