function truncate() {

        // Build list of entries
        var entries = [];
        for (var old_id in history)
            entries.push(history[old_id]);

        // Avoid history growth beyond defined number of entries
        if (entries.length > IDEAL_LENGTH) {

            // Sort list
            entries.sort(GuacamoleHistory.Entry.compare);

            // Remove entries until length is ideal or all are recent
            var now = new Date().getTime();
            while (entries.length > IDEAL_LENGTH 
                    && now - entries[0].accessed > CUTOFF_AGE) {

                // Remove entry
                var removed = entries.shift();
                delete history[removed.id];

            }

        }

    }
The maximum age of a history entry before it is removed, in
milliseconds.