Loading ...
Sorry, an error occurred while loading the content.
 

Re: Miscalculation of amount of memory

Expand Messages
  • Bram Moolenaar
    ... Unfortunately the patch included is a hack that won t work on anything but a few specific systems. There should at least be a configure check for the
    Message 1 of 2 , Jul 8, 2006
      Karsten Hopp wrote:

      > Bastien Nocera noticed a problem with the way how vim calculates the
      > available memory.
      > His bugreport is for vim-6.3, but it looks to be valid for vim-7 as well.
      > Please have a look at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=194040
      > for the details.

      Unfortunately the patch included is a hack that won't work on anything
      but a few specific systems.

      There should at least be a configure check for the mem_unit member.

      Changing long_u to be "long long" is wrong, this should be done locally
      where "mem" is used. And it requires a configure check for "long long".

      Then all places where "mem" is used need to be checked. It's compared
      against rlim_cur, that doesn't look right.

      The result should probably be trucated to a 32 bit number. I don't
      think that Vim should ever use more than 4 Gbyte of RAM. Except on 64
      bit machines perhaps.

      I can't do any of this since my system doesn't have sysinfo.

      Another solution is that the weird mem_unit thing is removed and
      totalram has the amount of ram, as it should have.

      --
      The word "leader" is derived from the word "lead", as in the material that
      bullets are made out of. The term "leader" was popularized at about the same
      time as the invention of firearms. It grew out of the observation that the
      person in charge of every organization was the person whom everyone wanted to
      fill with hot lead.
      I don't recomment this; it's just a point of historical interest.
      (Scott Adams - The Dilbert principle)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.