delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/03/22/02:16:51

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
:content-transfer-encoding; q=dns; s=default; b=YOQVx3mq3Dd9hvat
PuecSwKi9JL8hcTnYWErPr+l9gX/zQaIwQb2Ng+PjOE/KtFAS3TP/k2y7s/960BE
/WWvIrntjxs0i0oBY/ypHmalHUjRor/l0pSj0G/14HzNkirrBKVb8PePjsVGY7Mc
tkmPcnnGksVgoAnk7qK/MxId8FQ=
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
:content-transfer-encoding; s=default; bh=ZSoP6GlfZYMxeMwhVoUN6m
dsPTI=; b=gnD0UL62/3b4zu8AFVyPmTHTQr+Wh/agO5fod3iJYFs9pXRfB3UDpq
bTlIDtT2rd6C27J2wlx2cchr2onxb03YL/s+JpgeiwYaV2z9iOEk3/yY1Ubc36UZ
UNIqn1yW7aQaINZ4dtYsvgHUJHVjjw8RmlheM/iB+3ByBVSYj7xds=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:001d01d, H*MI:sk:001d01d, H*i:sk:001d01d, reserved
X-HELO: mail-wr0-f172.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:content-transfer-encoding; bh=RjM8uM5/yV8RLilERuR7ibM71R2uSEdkfdJ5K8QD+lM=; b=pmnXTN20+MqQQDITEHWkzvm8WKetq03+FSacabCB+agooGzwXCUM6iuP3d37esDL1X lO7sQb37Uw6POWlDmrRTzvKEqn3gYZOBJboZOKjP+WlKGTD/bz8rfRGJ8m7ABTOSY/UU KVFUDfOqo4OVo96w/tIDw4lV86LIGj5DzpIyuo/Iep5/l0kGZ52XEdUwvMFrCqvbGrsA r/OSvmbdvvoc9IXEkbGzDHjn+Y57d1Hd08Mty7wpC2/Mw06F4bpHO0UGnos/8ka4C2Xn F7DHo4sCFcshHgVMWqS13eyC1P/FTCkdpGAjv7MmL/uTtVEthTzAOU/a8bcf2ztApAd5 cU2w==
X-Gm-Message-State: AFeK/H3bemH0Mpo4KZOaxaGLyRQISQUNjA7XS9d9S7KifFsGz0tYsS6s5Ho3rOLrvmGv6Q==
X-Received: by 10.223.150.123 with SMTP id c56mr32858230wra.202.1490163389570; Tue, 21 Mar 2017 23:16:29 -0700 (PDT)
Subject: Re: Memory problems running C programs using GCC in NetBeans/Cygwin on Windows
To: cygwin AT cygwin DOT com
References: <001d01d2a297$c0761050$416230f0$@dsl.pipex.com>
From: Marco Atzeri <marco DOT atzeri AT gmail DOT com>
Message-ID: <af68eaaa-eb14-4f6a-911f-6d5a09a98e74@gmail.com>
Date: Wed, 22 Mar 2017 07:16:24 +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: <001d01d2a297$c0761050$416230f0$@dsl.pipex.com>
X-IsSubscribed: yes

On 22/03/2017 00:06, Martin O'Shea wrote:
> Hello
>
> I am using a 64 bit GCC compiler in NetBeans to compile a series of C
> programs which use the GMP multiple precision library to calculate numbers
> with varying lengths of zeroes. The programs are called from a shell script
> run from NetBeans or using Cygwin on Windows.
>

>
> The Windows PC concerned has 8Gb memory and according to the following piece
> of C code, the 64 bit version of Cygwin has 2Gb memory available:
>
>     #include <stdio.h>
>     #include <stdlib.h>
>
>     int main(int argc, char** argv) {
>
>         unsigned int bit = 0x40000000, sum = 0;
>         char *x;
>
>         while (bit > 4096) {
>             x = malloc(bit);
>             if (x)
>                 sum += bit;
>             bit >>= 1;
>         }
>         printf("%08x bytes (%.1fMb)\n", sum, sum / 1024.0 / 1024.0);
>
>         return (EXIT_SUCCESS);
>     }
>
> Given that the programs run without fault in Unix, I am assuming that there
> must be an environmental issue concerning memory when running the programs
> on Windows. Therefore, can anyone suggest if there is a way to increase
> memory to the GCC compiler within NetBeans or for the project I have, or to
> use `makefile` options to increase memory?
>
> I am using version 5.4.0 of GCC as given below:
>
>     $ gcc -v
>     Using built-in specs.
>     COLLECT_GCC=gcc
>     COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/lto-wrapper.exe
>     Target: x86_64-pc-cygwin
>
> 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


> Thanks
>
> Martin O'Shea.

Regards
Marco

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019