Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.datemas.de!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: C/C++ question about dynamic "static struct" Date: Sat, 20 Oct 2012 11:47:48 +1300 Lines: 24 Message-ID: References: <507F380B.2060402@verizon.net> <8q66l9-lkm.ln1@wilbur.25thandClement.com> <02f11126-3697-46db-ba7e-bcf63667bb52@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 2Ofx7ANRCe4aVPL3PZhAAQRTFDIb1zy1TJTzyAWwR+Zk6K2HLFNuFs5FbiSfg4ztRJ Cancel-Lock: sha1:Nafo4/ou5jNrZp62razRRS70AmE= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:12.0) Gecko/20120423 Thunderbird/12.0 In-Reply-To: Xref: csiph.com comp.lang.c++:19109 On 10/20/12 10:24, Juha Nieminen wrote: > Öö Tiib wrote: >> I think that Juha has had bad experience with that above. On the >> flip-side he probably has no experience how Java's garbage collector >> also hangs an application for 15 minutes with 6GB of application's >> memory used. So allocating lot of little crap is harmful for both >> languages, just that C++ has more and better ways how to climb out >> of the hole. > > I'm not saying there aren't situations in Java when the GC engine > becomes a real resource hog, but in typical-sized programs handling > typical amounts of data it's not very usual, AFAIK. The same could be said for C++ and the standard allocator. In both languages it is extreme cases that cause problems. I guess with it's greater flexibility, C++ offers more opportunities for optimisation. > I suppose that both in Java and C++ you need to know how to optimize > your memory usage if you want maximum efficiency. Indeed. -- Ian Collins