Is there a memory limit for a single vim instance ?

1,039 views
Skip to first unread message

winterTTr

unread,
Oct 19, 2009, 6:10:57 AM10/19/09
to vim...@googlegroups.com
I don't know much about the memory management for the vim.
But , recently , my gvim ( gvim72 under WinXP ) always give a warning
about "Out of memory! (allocating %d bytes)" where %d is a number .
The warning appeared sometimes, but not every time.

I try to autoload some python module ( written by myself ) via "pyfile
filename.py"
in my vimrc , and everything goes well except the warning sometimes.

I think maybe the python script is a bit complex ( about 10 files ,
50K totally )
but there is indeed a enough memory for vim .

Is there a memory limit for the vim?
Or , does someone see this problem before because the load of some python code ?

Tony Mechelynck

unread,
Nov 19, 2009, 1:55:48 AM11/19/09
to vim...@googlegroups.com, winterTTr
On 19/10/09 12:10, winterTTr wrote:
>
> I don't know much about the memory management for the vim.
> But , recently , my gvim ( gvim72 under WinXP ) always give a warning
> about "Out of memory! (allocating %d bytes)" where %d is a number .
> The warning appeared sometimes, but not every time.

Which patchlevel? See http://ftp.vim.org/pub/vim/patches/7.2/README for
a one-line summary of each of the more than 300 official patches since
Vim 7.2 was released. The ":version" command tells you (near the top)
which patches are included, or if it doesn't then you don't have any.

>
> I try to autoload some python module ( written by myself ) via "pyfile
> filename.py"
> in my vimrc , and everything goes well except the warning sometimes.
>
> I think maybe the python script is a bit complex ( about 10 files ,
> 50K totally )
> but there is indeed a enough memory for vim .
>
> Is there a memory limit for the vim?

yes, see ":help limits". The default memory size for the whole of Vim is
either half of your RAM, or an OS-dependent value between 2 and 10
magabytes, whichever is largest; but you can increase or decrease the
value, see
:help 'maxmemtot' " for the whole of Vim
:help 'maxmem' " for each separate edit buffer
:help 'maxmempattern' " workarea for pattern matching

With modern computers (whose RAM is counted in gigabytes) the former two
default to half your RAM, the latter to one megabyte.

> Or , does someone see this problem before because the load of some python code ?

Could be -- I don't know how python (and the Vim-python interface, and
your python module) manage memory. Do you really have to run that
complex a python module inside of Vim? Couldn't you either run it
externally (with the :! command or the system() function), or else
convert as much of it as possible to vimscript, and only interface to
Python for computations that Vim cannot do all by itself?


Best regards,
Tony.
--
Sorry, no fortune this time.

Henrik Öhman

unread,
Nov 19, 2009, 8:53:36 AM11/19/09
to vim_dev
I've seen this error on XP and Vista at odd occasions. It usually goes
away after I remove $HOME\_viminfo, but not always. Anyway, I haven't
found a case where it's reliably reproduceable. It also seems like the
memory related bugfixes over the last couple of years have resulted in
fewer occasions where this error appears.

As a first step, try and remove the _viminfo file, and see if that
helps.

Regards,
Henrik.

winterTTr

unread,
Nov 19, 2009, 9:47:18 AM11/19/09
to vim...@googlegroups.com
I tried , but didn't see the error.
And since i get the code from svn (which is patch before 267 )
and compile the new one, the error seems not to appear again.

I can not make sure whether some patch fix it, but you can try 
to compile the new one , which would become a solution , anyway.
 

Regards,
Henrik.


Reply all
Reply to author
Forward
0 new messages