A cache memory system comprising: means for writing data to a cache memory including a plurality of cache memory lines,,,,,,; a plurality of dirty masks, the number of the plurality of dirty masks being less than the number of cache memory lines; means for allocating a dirty mask to a respective cache memory line when a write to the respective cache memory line is not a full write to the respective cache memory line, wherein the dirty mask indicates a dirty state of data units in the respective cache memory line, wherein allocating comprises storing, in the respective cache memory line, identification information comprising a pointer to the location of the allocated dirty mask, wherein the identification information associates the allocated dirty mask with the respective cache memory line, and storing, in the respective cache memory line, a dirty flag, wherein the dirty flag indicates that at least one byte in the cache line is dirty; means for updating the allocated dirty mask following a subsequent write to the respective cache memory line; means for setting a fully dirty flag stored in the respective cache memory line to indicate that each data unit in the respective cache memory line is dirty, when the allocated dirty mask indicates that each data unit in the respective cache memory line is dirty; and means for de-allocating the dirty mask from the respective cache memory line when each data unit in the respective cache memory line is dirty; and means for de-allocating the dirty mask from the respective cache memory line when each data unit in the respective cache memory line is no longer dirty. means for writing data to a cache memory including a plurality of cache memory lines,,,,,,; a plurality of dirty masks, the number of the plurality of dirty masks being less than the number of cache memory lines; means for allocating a dirty mask to a respective cache memory line when a write to the respective cache memory line is not a full write to the respective cache memory line, wherein the dirty mask indicates a dirty state of data units in the respective cache memory line, wherein allocating comprises storing, in the respective cache memory line, identification information comprising a pointer to the location of the allocated dirty mask, wherein the identification information associates the allocated dirty mask with the respective cache memory line, and storing, in the respective cache memory line, a dirty flag, wherein the dirty flag indicates that at least one byte in the cache line is dirty; means for updating the allocated dirty mask following a subsequent write to the respective cache memory line; means for setting a fully dirty flag stored in the respective cache memory line to indicate that each data unit in the respective cache memory line is dirty, when the allocated dirty mask indicates that each data unit in the respective cache memory line is dirty; and means for de-allocating the dirty mask from the respective cache memory line when each data unit in the respective cache memory line is dirty; and means for de-allocating the dirty mask from the respective cache memory line when each data unit in the respective cache memory line is no longer dirty.