public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [ATTN: procps maintainer] RealPageSize
@ 2017-05-04 15:00 Marty Shannon
  2017-05-04 16:27 ` Marco Atzeri
  0 siblings, 1 reply; 2+ messages in thread
From: Marty Shannon @ 2017-05-04 15:00 UTC (permalink / raw)
  To: cygwin

This fix for php (posted by ricardohenrylee@gmail.com) should be
applied to the code for "top"; it (and /usr/bin/time -v) think the
page size is actually 64k, and reports RESident size as 16 times what
it should be.

 # if HAVE_UNISTD_H
 #  include <unistd.h>
 #  if defined(_SC_PAGESIZE)
+#   ifdef __CYGWIN__
+#    define REAL_PAGE_SIZE 4096
+#   else
 #    define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
+#   endif
 #  elif defined(_SC_PAGE_SIZE)
 #    define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
 #  endif

Cheers,
Marty

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ATTN: procps maintainer] RealPageSize
  2017-05-04 15:00 [ATTN: procps maintainer] RealPageSize Marty Shannon
@ 2017-05-04 16:27 ` Marco Atzeri
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Atzeri @ 2017-05-04 16:27 UTC (permalink / raw)
  To: cygwin

On 04/05/2017 17:00, Marty Shannon wrote:
> This fix for php (posted by ricardohenrylee@gmail.com) should be
> applied to the code for "top"; it (and /usr/bin/time -v) think the
> page size is actually 64k, and reports RESident size as 16 times what
> it should be.
>
>  # if HAVE_UNISTD_H
>  #  include <unistd.h>
>  #  if defined(_SC_PAGESIZE)
> +#   ifdef __CYGWIN__
> +#    define REAL_PAGE_SIZE 4096
> +#   else
>  #    define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
> +#   endif
>  #  elif defined(_SC_PAGE_SIZE)
>  #    define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
>  #  endif
>
> Cheers,
> Marty
>

How is top measuring the memory of process ?

   /proc/<pid>/statm

should report the correct info in
sysconf(_SC_PAGESIZE) = 64K units.


https://cygwin.com/ml/cygwin-patches/2016-q4/msg00009.html

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-04 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 15:00 [ATTN: procps maintainer] RealPageSize Marty Shannon
2017-05-04 16:27 ` Marco Atzeri

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