mån 2006-08-07 klockan 17:50 +0800 skrev Steven:

> Once an object reachs store_maxobjsize (in my case 128K), it falls through
> and eventually runs storeCheckCachable() and figures out that the object
> is not cachable.  The problem here is that if all data has been sent to
> the client, there is nothing to kick the store entry into freeing the
> memory.

Makes sense.

> The attached patch is one solution.

Hmm. found the code not very obvious to follow here and your patch
didn't exacly improve this..

What do you think about having the call at the end of
storeCheckCachable() just after the object is marked uncacheable, or
perhaps better yet move that part of the logics up to storeSwapout
making the conditions easier to follow.

I.e. something like the attached variant of the patch.

Regards
Henrik
Index: src/store.c
===================================================================
RCS file: /cvsroot/squid/squid/src/store.c,v
retrieving revision 1.565
diff -u -p -r1.565 store.c
--- src/store.c	17 Jul 2006 02:32:00 -0000	1.565
+++ src/store.c	7 Aug 2006 10:51:22 -0000
@@ -1230,8 +1230,6 @@ storeCheckCachable(StoreEntry * e)
 	store_check_cachable_hist.yes.Default++;
 	return 1;
     }
-    storeReleaseRequest(e);
-    EBIT_CLR(e->flags, ENTRY_CACHABLE);
     return 0;
 }
 
Index: src/store_swapout.c
===================================================================
RCS file: /cvsroot/squid/squid/src/store_swapout.c,v
retrieving revision 1.94
diff -u -p -r1.94 store_swapout.c
--- src/store_swapout.c	2 Jun 2006 00:07:40 -0000	1.94
+++ src/store_swapout.c	7 Aug 2006 10:51:22 -0000
@@ -241,11 +241,16 @@ storeSwapOut(StoreEntry * e)
     if (e->swap_status == SWAPOUT_NONE) {
 	assert(mem->swapout.sio == NULL);
 	assert(mem->inmem_lo == 0);
-	if (storeCheckCachable(e))
+	if (storeCheckCachable(e)) {
 	    storeSwapOutStart(e);
-	else
+	} else {
+	    storeReleaseRequest(e);
+	    /* free any unwanted mem data to ensure it doesn't get
+	     * stuck in memory
+	     */
+	    storeSwapOutMaintainMemObject(e);
 	    return;
-	/* ENTRY_CACHABLE will be cleared and we'll never get here again */
+	}
     }
     if (NULL == mem->swapout.sio)
 	return;

Attachment: signature.asc
Description: Detta är en digitalt signerad meddelandedel

Reply via email to