<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Memory Issues </TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.61 "><LINK REL="HOME" TITLE="The KMidi Handbook" HREF="index.html"><LINK REL="UP" TITLE="Design " HREF="design.html"><LINK REL="PREVIOUS" TITLE="Computation Issues " HREF="computation-issues.html"><LINK REL="NEXT" TITLE="Credits " HREF="credits.html"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="stylesheet" HREF="common/kde-common.css" TYPE="text/css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META HTTP-EQUIV="Content-Language" CONTENT="en"><LINK REL="stylesheet" HREF="common/kde-localised.css" TYPE="text/css" TITLE="KDE-English"><LINK REL="stylesheet" HREF="common/kde-default.css" TYPE="text/css" TITLE="KDE-Default"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#AA0000" VLINK="#AA0055" ALINK="#AA0000" STYLE="font-family: sans-serif;" ><DIV CLASS="logoheader" ><A HREF="http://www.kde.org/" ><IMG SRC="common/logotp3.png" BORDER="0" ALT="The K Desktop Environment" HEIGHT="62" WIDTH="229"></A ></DIV ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >The <SPAN CLASS="APPLICATION" >KMidi</SPAN > Handbook</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="computation-issues.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 4. Design</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="credits.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="MEMORY-ISSUES" >4.6. Memory Issues</A ></H1 ><P >It's possible for TiMidity to use an excessive amount of memory for patches. Symptoms are your window system becoming very sluggish, or crashing. This is probably only a problem when using big sf2 soundfonts of 30+ megabytes. For instance, the piano patches in Personal Choice's PC400 soundfont can occupy 25 megs each. After playing a list of midi files which use three of these pianos, well, that's 75 megs of ram right there. In its configuration dialog, KMidi lets you set a maximum number of megs to be used to keep patches used in playing previous midi files; when this maximum is exceeded, TiMidity will unload least recently used patches, returning ram to the system. The default maximum is 60 megs, which works ok on my system (I have 48 megs ram and 196 megs cache). Setting this to a lower value means that more patches have to be reloaded from patch files as you play through a list of midi songs, which slows things up. If you're ram rich, you can set it to "no limit". If you allowed enough room, entire soundfont files are read at once, instead of patch by patch. Setting the maximum too low can be counterproductive, because soundfont files occupy much less memory in toto when the entire file is read than when the patches are read individually (I don't know why).</P ><P >For little-endian systems like x86, rather than being read in, sf2 soundfonts are mmapped. This is much faster on startup. I haven't figured out a way to do this for big-endian systems.</P ><P >After playing each midi file, KMidi will report in the info window on how much memory is currently occupied by patches.</P ><P >If you don't have much ram or cache memory, setting a low maximum for patch memory might not prevent KMidi from crashing your system. So be careful using big soundfonts.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="computation-issues.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="credits.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Computation Issues</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="design.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Credits</TD ></TR ></TABLE ></DIV ></BODY ></HTML >