[Cosmo-dev] Re: [commits-cosmo] (rletness) [4051] calculate calendar bytes length at time of spooling to ensure

Brian Moseley bcm at osafoundation.org
Fri Apr 6 09:10:32 PDT 2007

On 4/6/07, svncheckin at osafoundation.org <svncheckin at osafoundation.org> wrote:

> + // convert Calendar object to String, then to bytes (UTF-8)
> + byte[] calendarBytes =
> getCalendar().toString().getBytes("UTF-8");

every time we add code to read an entire calendar or request content
or other arbitrarily large chunk of data into memory i get cold chills
down my spine. we already know that the server consumes huge amounts
of memory in normal operation, and we should be in the habit of
reducing that wherever possible, not adding to it.

i understand what you're trying to do here, randy, and i don't have
another solution to propose for this particular problem or for the
larger problem of copying big chunks of data around, but saving memory
usage where we can is something we need to focus on.

More information about the cosmo-dev mailing list