public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: natan_b@libero.it, "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Probable bug
Date: Sun, 30 Jul 2023 07:29:10 -0400	[thread overview]
Message-ID: <bf5f14f8-8dfd-13da-87b5-a0117fd04b05@cs.umass.edu> (raw)
In-Reply-To: <199362107.5561484.1690709920649@mail1.libero.it>

On 7/30/2023 5:38 AM, natan_b--- via Cygwin wrote:
> Hi Guys
> 
> very short.
> 
> prog.c
> 
> #include <stdio.h>
>   
> int main()
> {
> float a=1.283;
> while(1)
> printf( "%f", a );
> }
>   
> run with
> $ ./prog.exe >/dev/null
>   
> in windows monitor process the process increase it's memory it arrive to many  Gb.
> It's not a machine problem, other PC have same problem.
>   
> Same program in wsl and MSYS2 works well!

This probably has to do with output buffering, and may happen even without
the >/dev/null since there are no line ends in the output.  It may work with
stdbuf -o0 (as in: stdbuf -o0 ./prog.exe >/dev/null) but may cause the program
to run more slowly (each character is sent to the device, when then immediately
discards it).  It would seem you're hoping for the internal libraries to
recognize the case of writing to /dev/null ...

Regards - EM

  reply	other threads:[~2023-07-30 11:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-30  9:38 natan_b
2023-07-30 11:29 ` Eliot Moss [this message]
2023-07-30 11:37   ` Takashi Yano
2023-07-31  9:41     ` Takashi Yano
2023-08-01  8:59       ` Takashi Yano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf5f14f8-8dfd-13da-87b5-a0117fd04b05@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    --cc=natan_b@libero.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).