Skip Menu |

This queue is for tickets about the Digest-CRC CPAN distribution.

Report information
The Basics
Id: 88014
Status: open
Priority: 0/
Queue: Digest-CRC

People
Owner: OLIMAUL [...] cpan.org
Requestors: bmoran [...] onehub.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Using "OO" mode and add method blows up memory
Date: Wed, 21 Aug 2013 15:54:17 -0700
To: bug-Digest-CRC [...] rt.cpan.org
From: Brian Moran <bmoran [...] onehub.com>
The 'add' method, as it stands today, seems to take the provided data, and just append it to a structure which is kept in memory. Only when the results are asked for does the crc function actually get run, and the data buffer used. So, if one is attempting to crc a large amount of data (say, a 2GB file), the memory used by the process using the add method grows by at least 2GB. It would be better to modify the 'add' method so that it will crc the buffer that is supplied, then save the partial result. It should not save any more data than necessary. The Digest::SHA1 and Digest::MD5 libraries work by computing partial sums buffer by buffer, and don't exhibit the memory consumption issue. Until it can be so modified, it would be very helpful to at document this behavior and warn to use the functional style (e.g. crc32("123456789")) instead of the OO style. Thanks, Brian Moran -- e: bmoran@onehub.com p: +1 206 390 4376 Onehub, Inc. www.onehub.com
Subject: Using "OO" mode and add method blows up memory 0.18
From: bmoran [...] onehub.com
On Wed Aug 21 18:54:34 2013, bmo wrote: This is in version 0.18