fix for bug 91795 "large downloads cause mozilla to consume too much memory".

Changed OnDataSizeChange() to abort when entry size exceeds cache capacity.
r=dougt, sr=darin.


git-svn-id: svn://10.0.0.236/trunk@121316 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gordon%netscape.com
2002-05-10 23:44:53 +00:00
parent ccb198ffca
commit 8dcbf5b04d
2 changed files with 14 additions and 1 deletions

View File

@@ -250,6 +250,12 @@ nsMemoryCacheDevice::OnDataSizeChange( nsCacheEntry * entry, PRInt32 deltaSize)
{
if (entry->IsStreamData()) {
// we have the right to refuse or pre-evict
PRUint32 newSize = entry->DataSize() + deltaSize;
if (newSize > mSoftLimit) {
nsresult rv = nsCacheService::GlobalInstance()->DoomEntry_Locked(entry);
NS_ASSERTION(NS_SUCCEEDED(rv),"DoomEntry_Locked() failed.");
return NS_ERROR_ABORT;
}
}
// adjust our totals