public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jb at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/25949] New: Unbounded I/O buffer memory usage for formatted IO Date: Tue, 24 Jan 2006 21:16:00 -0000 [thread overview] Message-ID: <bug-25949-11659@http.gcc.gnu.org/bugzilla/> (raw) In some places the IO library simply assumes that the IO request is 'small enough', and happily allocates a buffer big enough for the request to be handled in one go. Unformatted IO already uses sread()/swrite() which bypasses buffering if the request is bigger than the buffer size. However, this has not been done for formatted IO. In some cases this results in excessive memory usage. A rather extreme (and admittedly contrived) example is program bigformdir integer :: i = 10**9 open (10, file="foo", form="formatted", access="direct", recl=i) write (10, '(i3)', rec=1) 1 close (10) end program bigformdir The above program will cause libgfortran to allocate 1 GB, fill it with ' ', and then write it. Clearly the allocation is not necessary. -- Summary: Unbounded I/O buffer memory usage for formatted IO Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: libfortran AssignedTo: jb at gcc dot gnu dot org ReportedBy: jb at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25949
next reply other threads:[~2006-01-24 21:16 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-01-24 21:16 jb at gcc dot gnu dot org [this message] 2006-01-24 21:23 ` [Bug libfortran/25949] " pinskia at gcc dot gnu dot org 2006-01-25 21:35 ` jb at gcc dot gnu dot org 2006-02-12 19:59 ` jb at gcc dot gnu dot org 2006-02-14 20:21 ` jb at gcc dot gnu dot org 2006-05-19 16:45 ` fxcoudert at gcc dot gnu dot org
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=bug-25949-11659@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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).