[ 
https://issues.apache.org/jira/browse/GEODE-9854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jakov Varenina updated GEODE-9854:
----------------------------------
    Description: 
Issue:
An OpLog files are compacted, but the .drf file is left because it contains 
deletes ofentries in previous .crfs. The .crf file is deleted, but the orphaned 
.drf is not until all
previous .crf files (.crfs with smaller id) are deleted.

The problem is that compacted Oplog object representing orphaned .drf file 
holds a structure in memory (Oplog.regionMap) that contains information that is 
not useful
after the compaction and it takes certain amount of memory. Besides, there is a 
race condition in the code when creating .krf files that, depending on the 
execution order,
could make the problem more severe (it could leave elements in the 
pendingKrfTags structure on the regionMap and this could take up a significant 
amount of memory).
This race condition usually happens when new Oplog is rolled out and previous 
Oplog is immediately marked as eligible for compaction. Compaction and .krf 
creation start at
the similar time and compactor cancels creation of .krf if it is executed 
first. The pendingKrfTags structure is usually cleared when .krf file is 
created, but sincecompaction canceled creation of .krf, the pendingKrfTags 
structure remain in memory until Oplog representing orphaned .drf file is 
deleted.

  was:
Issue:
An OpLog files are compacted, but the .drf file is left because it contains 
deletes of
entries in previous .crfs. The .crf file is deleted, but the orphaned .drf is 
not until all
previous .crf files (.crfs with smaller id) are deleted.

The problem is that compacted Oplog object representing orphaned .drf file holds
a structure in memory (Oplog.regionMap) that contains information that is not 
useful
after the compaction and it takes certain amount of memory. Besides, there is a 
race
condition in the code when creating .krf files that, depending on the execution 
order,
could make the problem more severe (it could leave elements in the 
pendingKrfTags
structure on the regionMap and this could take up a significant amount of 
memory).
This race condition usually happens when new Oplog is rolled out and previous 
Oplog
is immediately marked as eligible for compaction. Compaction and .krf creation 
start at
the similar time and compactor cancels creation of .krf if it is executed first.
The pendingKrfTags structure is usually cleared when .krf file is created, but 
since
compaction canceled creation of .krf, the pendingKrfTags structure remain in 
memory
until Oplog representing orphaned .drf file is deleted.


> Orphaned .drf files causing memory leak
> ---------------------------------------
>
>                 Key: GEODE-9854
>                 URL: https://issues.apache.org/jira/browse/GEODE-9854
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Jakov Varenina
>            Priority: Major
>
> Issue:
> An OpLog files are compacted, but the .drf file is left because it contains 
> deletes ofentries in previous .crfs. The .crf file is deleted, but the 
> orphaned .drf is not until all
> previous .crf files (.crfs with smaller id) are deleted.
> The problem is that compacted Oplog object representing orphaned .drf file 
> holds a structure in memory (Oplog.regionMap) that contains information that 
> is not useful
> after the compaction and it takes certain amount of memory. Besides, there is 
> a race condition in the code when creating .krf files that, depending on the 
> execution order,
> could make the problem more severe (it could leave elements in the 
> pendingKrfTags structure on the regionMap and this could take up a 
> significant amount of memory).
> This race condition usually happens when new Oplog is rolled out and previous 
> Oplog is immediately marked as eligible for compaction. Compaction and .krf 
> creation start at
> the similar time and compactor cancels creation of .krf if it is executed 
> first. The pendingKrfTags structure is usually cleared when .krf file is 
> created, but sincecompaction canceled creation of .krf, the pendingKrfTags 
> structure remain in memory until Oplog representing orphaned .drf file is 
> deleted.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to