Yakov Lerner wrote: > On 4/6/07, Yakov Lerner <[EMAIL PROTECTED]> wrote: > > On 4/6/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > I did th3 follwing: With a program, which generates random numbers in > > > different formats, I created a file, which consists of _one_ line of > > > 2097152 characters ("0"-"9","A"-"F"). > > > > > > To split the line into lines of 72 characters each, I started vim and > > > let it read the file. > > > > > > I postioned the cursor at position 0 and entered the following in > > > normal mode: > > > > > > qq72<right>i<return><esc>0q > > > > > > Then I did a > > > > > > [EMAIL PROTECTED] > > > > > > After only 10 or 15 (guessed) executions of the macro the system > > > freezes while constantly swapping (?) and became unuseable and did no > > > longer respond. > > > > > > Even the mouse pointer was nearly unmoveable... > > > > > > After heavily and constantly trying I managed to kill the X-session > > > and to 'killall -9 vim' from the console to get back my computer. > > > > Hello Meino "the vim killer" Cramer, > > I tried your scenario. You need to add 'set ul=-1' to disable undoes, and > > 'set lz' to disable excess redraws. Even then, vim goes rather slow at > > this task. > > > > Indeed, vim grows to >1000MB vm/rss size > > size in matter of one minute without ul=-1 (, and growing very fast. ) > > The thing I find strange here is that values of 'maxmem', 'maxmemtot' were: > > :set mm? mmt? > maxmem=643272 > maxmemtot=643272 > > , yet vim grew past x2.5 times that limits (with default 'ul') > without messages. > Is this expected behaviour ?
The 'maxmem' and 'maxmemtot' are for the text that is kept in memory. Above these limits text is put in the swap file. Text that is kept for undo is always in memory and there is no limit for the amount, there is only 'undolevels'. See ":help limits". I think the problem with the way lines are split here is that you go in and out of Insert mode for every change. This causes the current line to be saved for undo every time. With a function that gets the line and inserts every 72 chararacters it's probably a lot faster. -- It doesn't really matter what you are able to do if you don't do it. (Bram Moolenaar) /// Bram Moolenaar -- [EMAIL PROTECTED] -- 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 ///