vi: Tmp file too large - ULIMIT?

John Plocher plocher at sally.Sun.COM
Thu Feb 8 19:38:48 AEST 1990


+-- In <1235 at rsiatl.UUCP> jgd at rsiatl.UUCP (John G. De Armond) writes
| >>>I cannot edit a large text file (~450K) using 'vi'.
| >>>It complains 'Tmp file too large' and switches to 'ed' mode.
| 
| You obviously hit a ulimit :-)
+--

No, not obviously.

The simple case is that you ran out of space in the root filesystem
and that the temp file (in /tmp) really was too large. :-)

The other case would be plausable if you weren't using the same
version of ISC Unix that John G. De Armond was using:

All the versions of vi source that I have seen have a define called
VMUNIX.  If that is not set, the code assumes a "Swapping" type of
memory subsystem (ala pdp11/Vr3.0...) and sets up things so that you
have fixed size tables (for line pointers...).  This effectively
limits you to "small" files (less than some number of lines) In the
Microport Vr3 386 case I was hitting the limit at less than 300k for
normal C source files.

If you define VMUNIX, the code assumes virtual memory and tries to
dynamically allocate things.

This does two things; the startup time is much less (no big data
structures to initialize) and you can suddenly edit huge files.  I
successfully edited a 30Mb file with the recompiled version...

What *is* obvious here is that ISC has recompiled vi with the VMUNIX
define turned on.

AT&T (for one) ships their version  without it defined.

   -John Plocher



More information about the Comp.unix.i386 mailing list