LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   vim takes long time to start (http://www.linuxquestions.org/questions/linux-newbie-8/vim-takes-long-time-to-start-791113/)

throughthegreens 02-23-2010 06:29 PM

vim takes long time to start
 
I'm having trouble with Vim in any terminal emulator I use. I have a link (vi) to vim. Occasionally it will take very long to load, whether I use 'vi' or 'vi file'. Before, if I could I would restart X, and then it would load instantly again, but I waited this time and it did load, after a minute or so. Is this a problem with X or vim?

chrism01 02-23-2010 06:39 PM

Difficult to tell... try leaving 'top' running in another window and check it if it happens again.

throughthegreens 02-23-2010 06:56 PM

I was able to trigger it by doing, from ~, "vi .fvwm/.fvwm2rc". I am watching top and nothing is coming up related to vim. I counted 168 seconds from ~30sec after I hit enter (with a while loop), and when it finally loaded the text area of vim had nothing in it, but :quit'ing and then pressing up->enter to repeat the command came up with the full file and it loads instantly now, everytime.

Tinkster 02-23-2010 07:20 PM

Super slow/super busy disk subsystem?
What does IO-stat tell you about the disk?

Next time the problem occurs try tunning vim under strace w/
timing information enabled.

throughthegreens 02-24-2010 06:01 PM

iostat:
Code:

root - 'MindStation': $ iostat
Linux 2.6.29.6-t40 (MindStation)        02/24/2010

avg-cpu:  %user  %nice %system %iowait  %steal  %idle
          9.16    0.00    4.20    6.02    0.00  80.62

Device:            tps  Blk_read/s  Blk_wrtn/s  Blk_read  Blk_wrtn
hda              15.28      556.53      117.91    385217      81616
hda1            15.05      550.47      117.91    381026      81616
hda2              0.06        1.59        0.00      1102          0
hda3              0.05        1.79        0.00      1236          0
hda4              0.10        2.54        0.00      1757          0

sorry I can't figure out where to go from here. I think the problem is a bad disk. next time it happens I'm gonna check syslog for buffer i/o errors

Tinkster 02-24-2010 06:40 PM

What mount point lives on hda1?

throughthegreens 02-25-2010 02:48 AM

root,/home,etc. everything. hda1 and hda2 are Slackware, hda3 swap, hda4 storage

zhjim 02-25-2010 04:05 AM

Whats the size of the file your trying to open? If I open up a 1G file with vim it just takes it time copying everything into memory.

throughthegreens 02-25-2010 01:08 PM

It's only 7.6K

throughthegreens 03-03-2010 01:46 PM

I finally had it happen again and did strace on it. I only noticed one part,
Code:

rt_sigaction(SIGUSR1, {0x815e1e0, [], 0}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {0x815e1e0, [], 0}, NULL, 8) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "Vim: Warning: Output is not to a "..., 42Vim: Warning: Output is not to a terminal
) = 42
nanosleep({2, 0}, NULL)                = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbff84488) = -1 ENOTTY (Inappropriate ioctl for device)
stat64("/home/matthew/.terminfo", 0xbff84454) = -1 ENOENT (No such file or directory)

which tells me that it's not connecting to the pts.
Eventually it shows up, but my strace doesn't go this far. it is at http://pastebin.ca/1821695


All times are GMT -5. The time now is 07:00 AM.