Re: [vim] vim creates large swp files

2021-02-26 Fir de Conversatie Charles Campbell

Kirill Ryzhkov wrote:


Hi Vim developers!
I use vim on Linux all the time and found a problem with creating just 
huge swp files that can take up all the hard disk space.
If you open vim and copy a large text that can cause the linux console 
to hang and then you force close the console, after a couple of days 
the swp file size can reach hundreds of gigabytes. I have already 
encountered this problem twice and each time I had to look for where 
these swp files were created in which directory.

I am using vim version 8.0.1453.
Maybe there is a new version that fixes this bug ?

No, but since you're a linux user you can handle this problem yourself 
with a cron job.
Use  crontab -e  to edit the cron table commands. (cron is a daemon that 
runs at your specified times to do some work).

# # # # # /path/to/script

#1: minute (0-59)
#2: hour (0-23)
#3: day-of-month (1-31)
#4: month (1-12)
#5: day-of-week (0-6)

The shell script or command you have cron run can then check for size 
for those files which look like swap files, and if they're too big and 
too old; delete it.
For example:  ...time-spec-here..  /usr/bin/find "/home/username" -type 
f -name '*.sw[a-z]' -atime 3 -size 2G -exec "/bin/rm" "{}" ";"


Note, I haven't tested the above line, and instead of removing the file, 
you may want to move it to some directory instead (to see if the command 
is doing what you want).

Suggested reading: man crontab, man find. UAYOR.

Chip Campbell

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/e7985590-7ed1-ec04-e8b7-4c66fcc4fded%40drchip.org.


Re: [vim] vim creates large swp files

2021-02-26 Fir de Conversatie Bram Moolenaar


Kirill Ryzhkov wrote:

> Hi Vim developers!
> I use vim on Linux all the time and found a problem with creating just huge 
> swp files that can take up all the hard disk space.
> If you open vim and copy a large text that can cause the linux console to 
> hang and then you force close the console, after a couple of days the swp 
> file size can reach hundreds of gigabytes. I have already encountered this 
> problem twice and each time I had to look for where these swp files were 
> created in which directory.
> I am using vim version 8.0.1453.
>  
> Maybe there is a new version that fixes this bug ?

No.  And it's not likely a problem that can be fixed.

The simplest way to handle this is to unload the buffer and open it
again.  Then a new swapfile will be used.

A swapfile of hundreds of gigabytes is very unusual though.  I don't see
how you can get that if you copy a large text.  Perhaps you have some
filter that causes lines to get longer, so they have to be moved around?
Or you work with very long lines, such as XML without any line breaks.
Can you give a reproducible example (without sending us a Gbyte file, of
course).

You can also disable the swapfile, although you then lose the ability to
restore your work after a crash.

-- 
Every exit is an entrance into something else.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202102261258.11QCw4fw189749%40masaka.moolenaar.net.


[vim] vim creates large swp files

2021-02-25 Fir de Conversatie Kirill Ryzhkov

Hi Vim developers!
I use vim on Linux all the time and found a problem with creating just huge 
swp files that can take up all the hard disk space.
If you open vim and copy a large text that can cause the linux console to 
hang and then you force close the console, after a couple of days the swp 
file size can reach hundreds of gigabytes. I have already encountered this 
problem twice and each time I had to look for where these swp files were 
created in which directory.
I am using vim version 8.0.1453.
 
Maybe there is a new version that fixes this bug ?
 
Thanks!

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/1ecc0791-74ca-4522-95e2-5caba96b11fdn%40googlegroups.com.