This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reproducible cygwin memory problems



From: Eli Zaretskii <eliz@gnu.org>

[I'm not subscribed to the Cygwin list, so please CC me directly.]

> From: "emacs user" <emacs_user@hotmail.com>
> Bcc:
> Date: Sat, 12 Aug 2006 07:46:33 -0400
> Cc: cygwin@cygwin.com
>
> Eli, here is a response from the cygwin list. thanks to Reini Urban for
> this.
>
> Look Eli,
> that's really a bold statement, esp. when elisp is involved.
> cygwin uses the newlib libc. How does it come to your mind that newlib's
> free() and subsequently Microsoft's VirtualFree (,MEM_RELEASE) doesn't
> work as advertised?
> Please see the src for newlib's free() at src/newlib/libc/stdlib/mallocr.c
> http://cygwin.com/cgi-bin/cvsweb.cgi/src/newlib/libc/stdlib/mallocr.c?rev=1.15&content-type=text/x-cvsweb-markup&cvsroot=src
>
>
> POSIX free() is not like perl or lisp, where there's no such concept of
> free(), if by lazyness or better strategies.
>
> POSIX free() and cygwin's free() does give back it's malloc'ed buffers
> back to the OS, and the OS does list them correctly as free.
>
> What you have here is an ELISP issue, which doesn't free it's interim's
> memory, and you falsely accuse the C part of the image library. Please
> have a look again in some lisp allocated buffers and then check if some
> free() is missing.


It's possible that I'm wrong, of course.  Let me state the facts and
observations that led me to my conclusion:

  . The OP reported that the problem happens only with image files.
    When he edits text files, the Emacs memory footprint stays at a
    reasonable value.

  . After killing the image buffer, the OP invoked the Lisp function
    clear-image-cache, which is supposed to release any memory used by
    Emacs for storing images.  There's no other Lisp memory that I can
    see in the sources that is used for images, and that could be left
    unreleased.  To be sure, I'd like to ask emacs_user@hotmail.com,
    who is the OP, to invoke "M-x garbage-collect RET" after
    clear-image-cache, and see if that changes anything.

tried that, no effect on memory usage. I used a fresh copy of latest (as of right now) gnu emacs from cvs, latest cygwin, after make distclean, configure, make.


  . The OP traced the Emacs code in clear-image-cache, and saw that
    the function in the image libraries that frees the image is indeed
    called.

  . Other Emacs builds, including the native Windows build and a
    GNU/Linux build, do not exhibit this behavior.

Given these observations, and the fact that the Cygwin build of Emacs
runs almost the same C and Lisp code as the GNU/Linux build, what
other factors can be involved here?

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]