Jan 5 2010

Is ‘mkinfo’ memory hungry or what?

I tried to identify what’s wrong with this 8GB Matroska file (a movie) and attempted to run mkvinfo on it. To my surprise, the FreeBSD 8.0 system almost locked up completely. After a while I hit Cntrl-C and the system went back to normal. So I ran it again, but this time I had top running in a 2nd window. Here’s what I saw (first few lines of top output):

last pid: 97715;  load averages:  0.36,  0.28,  0.14
108 processes: 7 running, 101 sleeping
CPU:  0.0% user,  0.0% nice, 41.5% system,  0.0% interrupt, 58.5% idle
Mem: 7027M Active, 40M Inact, 371M Wired, 409M Cache, 821M Buf, 11M Free
Swap: 8192M Total, 7183M Used, 1009M Free, 87% Inuse, 112K In, 16M Out
  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
97713 thoellri        1  45    0   771G  7059M RUN     1   0:24  9.47% mkvinfo

And the top output after I killed mkvinfo again:

last pid: 98017;  load averages:  0.46,  0.36,  0.19
115 processes: 1 running, 114 sleeping
CPU:  0.0% user,  0.0% nice,  0.2% system,  0.2% interrupt, 99.6% idle
Mem: 132M Active, 58M Inact, 325M Wired, 7156K Cache, 821M Buf, 7337M Free
Swap: 8192M Total, 499M Used, 7693M Free, 6% Inuse
  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
55423 root            1  44    0 42144K   800K select  1  38:49  0.00% smbd

I highlighted the interesting portions above. Yes, mkvinfo asked for 771GB of memory to analyze an 8GB file. My system didn’t do anything else but swap pages in and out. Sooner or later the process would have been killed with an out-of-memory error.

Anybody know if this is a FreeBSD-only problem? Any other way to peek inside .mkv files (other than opening them in VLC)?

Leave a Reply