imay commented on a change in pull request #4751:
URL: https://github.com/apache/incubator-doris/pull/4751#discussion_r505979369



##########
File path: be/src/olap/page_cache.cpp
##########
@@ -19,15 +19,10 @@
 
 namespace doris {
 
-// This should only be used in unit test. 1GB
-static StoragePageCache s_ut_cache(1073741824);
-
-StoragePageCache* StoragePageCache::_s_instance = &s_ut_cache;
+StoragePageCache* StoragePageCache::_s_instance = nullptr;
 
 void StoragePageCache::create_global_cache(size_t capacity) {
-    if (_s_instance == &s_ut_cache) {
-        _s_instance = new StoragePageCache(capacity);
-    }
+    _s_instance = new StoragePageCache(capacity);

Review comment:
       This will lead memory leak in unit test




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to