X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=cGc3 JQDupa+V0FbxFNk2NeivbBrQTtm/t6ELTqGWNZpSDBq/2aGis/NHDki86RzcL9VY B6EduZ7PosMPfx1V2GBVZA2LFijyZ/a2UA7wpvQEyh+M/48ccE1itqy8R/1czp8+ FvhSU/F7k0YlxsmeEZtAniGzxQXmNMLYd7/E7h4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=oJctJ5sOfd 2/g/HHxu25FZJVs9c=; b=kBUQP24ft7XyHsvJzy/XxNCENQg7lGIglk/yEab6Q6 VfjPcpaB6JdfpLmtyyqNMzB3/+V+nJfcWr8VANFDWK0U5vOCLKk6lcBvoDKVGX8r UmkDYGCx7WY5XqtEbl1p5pwcMtWJIi27QDkhYOGf3Wv+P4WnLQ9v6ugfbErPu2lx w= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=8GB, (unknown), reserved, morning X-HELO: mail-wm0-f51.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=gy48F+UlR9NeBJeF7KApvIPfiBXUg2blEpn4i2PI7ww=; b=ARSizDX8gBevINWYp2W/hl8ZQ3bl1k3dC972cwyWntxnzJj51x1Z3VkyLGkolrlNtf r+pIZJ+aiOw8uX7mKhFiJy57ZLQ0NzslCj+tmbWH/6ENqabRh0VVuGDlJK1I+sQOBpAw UQOCcJmdTP4Rd75c45LzTADDJtY4TYG4Qs19SWEPa6bB8fvIIUxnl0j/Mcduj3iYObaz vrvf+cFRJ9wZc2xxlO9N9OJf/ZOJ1I9dSKHnwCQKOtf/dREFlymc+Zg8SoZWGUEZw+6H dKLYEDnijASjzb2ufbgFg3iozolsTkFOA6DF9DcGCXO0ls7C1MkDu0iderczOwtUTxhp npEA== X-Gm-Message-State: AFeK/H3aP9pF9zeqpFhc9A9SIsIm+7n8urasO9drIjpODuLNXiw0NnMN/5dYNN5gcEJhXw== X-Received: by 10.28.57.11 with SMTP id g11mr6714774wma.2.1490176148223; Wed, 22 Mar 2017 02:49:08 -0700 (PDT) Subject: Re: Memory problems running C programs using GCC in NetBeans/Cygwin on Windows To: "Martin O'Shea" , "cygwin AT cygwin DOT com" References: <8punym7avg33ox0kq30bjlxb DOT 1490165447681 AT email DOT android DOT com> From: Marco Atzeri Message-ID: Date: Wed, 22 Mar 2017 10:49:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8punym7avg33ox0kq30bjlxb.1490165447681@email.android.com> Content-Type: multipart/mixed; boundary="------------7CCE3C4FE5FC0C4BD35AE6CE" X-IsSubscribed: yes --------------7CCE3C4FE5FC0C4BD35AE6CE Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit please reply on the mailing list and use bottom post for replies as standard practice. On 22/03/2017 07:50, Martin O'Shea wrote: > Thanks for the response but can I ask that you clarify what you mean? > > I am something of a Cygwin newbie. >> >> I also do not understand why the memory checker program returns 2Gb. > > 2Gb is the largest block available. > As you never use free you have reserved ~ 4Gb Too early in the morning for me. It failed at 2Gb The modified version will clarify the point I was aiming to. It runs the request 5 times from 4K to max block available 7ffe0000 bytes (2047.9Mb) 60000000 bytes (1536.0Mb) 40000000 bytes (1024.0Mb) 40000000 bytes (1024.0Mb) 40000000 bytes (1024.0Mb) 640040000 bytes (25600.2Mb) so the largest block available the first time is almost 2GB, the second time the largest block is 1.5 GB and all the rest is 1Gb, however the overall memory allocated was ~ 25 Gb on a X86_64 machine with just 8GB of physical RAM. I can not reserve a single block of 25 GB but I can reserve a lot of smaller blocks. The limitation on single block max size is likely due to the underlying Windows system. Regards Marco --------------7CCE3C4FE5FC0C4BD35AE6CE Content-Type: text/plain; charset=UTF-8; name="max_memory-3s.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="max_memory-3s.c" I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KaW50IG1h aW4oKQp7CiAgc2l6ZV90IGJpdD0weDQwMDAwMDAwLCBzdW09MCwgdG90YWw9 MDsKICBjaGFyICp4OwogIAogIHdoaWxlIChiaXQgPiA0MDk2KSAKICB7CiAg ICB4ID0gbWFsbG9jKHN1bSk7CiAgICBpZiAoeCl7Cgl0b3RhbCArPSBzdW07 CiAgICAJc3VtICs9IGJpdDsKICAgIH0KICAgIGJpdCA+Pj0gMTsKICB9CiAg cHJpbnRmKCIlMTJseCBieXRlcyAoJS4xZk1iKVxuIiwgc3VtLCBzdW0vMTAy NC4wLzEwMjQuMCk7CiAgYml0PTB4NDAwMDAwMDAsIHN1bT0wOwoKICB3aGls ZSAoYml0ID4gNDA5NikKICB7CiAgICB4ID0gbWFsbG9jKHN1bSk7CiAgICBp ZiAoeCl7Cgl0b3RhbCArPSBzdW07CiAgICAgICAgc3VtICs9IGJpdDsKICAg IH0KICAgIGJpdCA+Pj0gMTsKICB9CiAgcHJpbnRmKCIlMTJseCBieXRlcyAo JS4xZk1iKVxuIiwgc3VtLCBzdW0vMTAyNC4wLzEwMjQuMCk7CiAgYml0PTB4 NDAwMDAwMDAsIHN1bT0wOwoKICB3aGlsZSAoYml0ID4gNDA5NikKICB7CiAg ICB4ID0gbWFsbG9jKHN1bSk7CiAgICBpZiAoeCl7CiAgICAgICAgdG90YWwg Kz0gc3VtOwogICAgICAgIHN1bSArPSBiaXQ7CiAgICB9CiAgICBiaXQgPj49 IDE7CiAgfQogIHByaW50ZigiJTEybHggYnl0ZXMgKCUuMWZNYilcbiIsIHN1 bSwgc3VtLzEwMjQuMC8xMDI0LjApOwoKICB3aGlsZSAoYml0ID4gNDA5NikK ICB7CiAgICB4ID0gbWFsbG9jKHN1bSk7CiAgICBpZiAoeCl7CiAgICAgICAg dG90YWwgKz0gc3VtOwogICAgICAgIHN1bSArPSBiaXQ7CiAgICB9CiAgICBi aXQgPj49IDE7CiAgfQogIHByaW50ZigiJTEybHggYnl0ZXMgKCUuMWZNYilc biIsIHN1bSwgc3VtLzEwMjQuMC8xMDI0LjApOwoKICB3aGlsZSAoYml0ID4g NDA5NikKICB7CiAgICB4ID0gbWFsbG9jKHN1bSk7CiAgICBpZiAoeCl7CiAg ICAgICAgdG90YWwgKz0gc3VtOwogICAgICAgIHN1bSArPSBiaXQ7CiAgICB9 CiAgICBiaXQgPj49IDE7CiAgfQogIHByaW50ZigiJTEybHggYnl0ZXMgKCUu MWZNYilcbiIsIHN1bSwgc3VtLzEwMjQuMC8xMDI0LjApOwogIHByaW50Zigi JTEybHggYnl0ZXMgKCUuMWZNYilcbiIsIHRvdGFsLCB0b3RhbC8xMDI0LjAv MTAyNC4wKTsKCiAgcmV0dXJuIDA7Cn0KCg== --------------7CCE3C4FE5FC0C4BD35AE6CE Content-Type: text/plain; charset=us-ascii -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --------------7CCE3C4FE5FC0C4BD35AE6CE--