[ 
https://issues.apache.org/jira/browse/GEODE-8537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17233053#comment-17233053
 ] 

ASF GitHub Bot commented on GEODE-8537:
---------------------------------------

pdxcodemonkey commented on a change in pull request #687:
URL: https://github.com/apache/geode-native/pull/687#discussion_r524527337



##########
File path: cppcache/src/LRUQueue.hpp
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#ifndef GEODE_LRUQUEUE_H_
+#define GEODE_LRUQUEUE_H_
+
+#include <list>
+#include <memory>
+
+#include <geode/internal/geode_globals.hpp>
+
+#include "util/concurrent/spinlock_mutex.hpp"
+
+namespace apache {
+namespace geode {
+namespace client {
+
+class MapEntryImpl;
+
+/**
+ * This class holds a queue of entries sorted by its use order
+ * @note All accesses to the queue are mutually exclusive
+ */
+class LRUQueue {

Review comment:
       boost::lockfree::queue, maybe?  If this is just a generic thread-safe 
queue implementation, we really shouldn't be writing our own.  This one uses 
our own hand-rolled mutex for locking, as well, which is _also_ a thing that we 
should never have written, that should be removed from the codebase altogether. 
 

##########
File path: cppcache/src/EvictionController.hpp
##########
@@ -75,29 +73,27 @@ class EvictionController {
 
   void svc(void);
 
-  void updateRegionHeapInfo(int64_t info);
-  void registerRegion(const std::string& name);
-  void deregisterRegion(const std::string& name);
-  void evict(int32_t percentage);
+  void evict(float percentage);
+  void inc_heap_size(int64_t delta);
+  void register_region(const std::string& name);
+  void unregister_region(const std::string& name);

Review comment:
       The style guide (I re-learned after reviewing it) dictates snake case 
for variables and setter/getter functions, and mixed case otherwise.  I prefer 
the mixed case for method names, for consistency if nothing else - can we 
change the instances of this in the PR?

##########
File path: cppcache/src/LRUQueue.hpp
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#ifndef GEODE_LRUQUEUE_H_
+#define GEODE_LRUQUEUE_H_
+
+#include <list>
+#include <memory>
+
+#include <geode/internal/geode_globals.hpp>
+
+#include "util/concurrent/spinlock_mutex.hpp"
+
+namespace apache {
+namespace geode {
+namespace client {
+
+class MapEntryImpl;
+
+/**
+ * This class holds a queue of entries sorted by its use order
+ * @note All accesses to the queue are mutually exclusive
+ */
+class LRUQueue {

Review comment:
       Let us know if there's some reason here we can't use an off-the-shelf 
queue solution.  Otherwise, let's use one of those.




----------------------------------------------------------------
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:
us...@infra.apache.org


> Memory increases whenever LRU eviction is enabled
> -------------------------------------------------
>
>                 Key: GEODE-8537
>                 URL: https://issues.apache.org/jira/browse/GEODE-8537
>             Project: Geode
>          Issue Type: Bug
>          Components: native client
>    Affects Versions: 1.13.0
>            Reporter: Mario Salazar de Torres
>            Assignee: Mario Salazar de Torres
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: massif-8419.png, massif.out.8419
>
>
> *HAVING* configured concurrency-checks-enabled=false in the client-cache.xml 
> for a region
> *HAVING* configured heap-lru-limit=10 in the client-cache.xml for the region 
> region
> *HAVING* configured heap-lru-delta=10 in the client-cache.xml for the region 
> region
> *HAVING* configured subscription-notification for the pool on which the 
> region is defined
> *HAVING* regsitered interest on all the keys of this region, values included
> *AFTER* receiving lots of LOCA_CREATE and LOCAL_DESTROY notifications
> *THEN* memory increases continously over time, even going over the LRU limit.
> Find massif tool report as massif.out.8419 showing the memory increase.
> Also this is a capture of massif-visualizer for the report:
> !massif-8419.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to