X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Krzysztof Duleba <krzysan@skrzynka.pl>
Subject:  Re: malloc/new allocate twice as much?
Date:  Sat, 31 Dec 2005 02:23:20 +0100
Lines: 16
Message-ID: <dp4mi3$oka$1@sea.gmane.org>
References:  <001e01c60d96$82fc34e0$43055f12@somerville>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
In-Reply-To: <001e01c60d96$82fc34e0$43055f12@somerville>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Dan Stratila wrote:

> This is an issue I've discovered and reproduced while trying to compile
> polymake (see the thread "gcc crash (memory?)"). It seems that both malloc
> and new allocate take up twice the amount of memory needed.
> 
> I wrote a short program to allocate and use memory in chunks (mem-test.cpp),
> and compiled it with g++ 3.4.4. I monitored it using the Windows Task
> Manager. When asked to allocate 100MB in increments of 10MB, the process
> size goes to 100MB and then drops to 0, as expected. However, the total
> commit charge for the machine goes up by 200MB, and then drops back!

Try the snapshot. On my laptop with XP SP2, 20051222 snapshot, 1GB RAM and 
1GB swap file I had no problem allocating 1.8 GB.

Krzysztof Duleba



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

