Proposal to remove explicit "GC disable" startup suggestion

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal to remove explicit "GC disable" startup suggestion

Ilya Korol
Hi, everyone.

There is a proposal to remove suggestion that user should disable
explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720.

Nowadays people usually don't use this facility directly without huge
need (at least we hope so), so this suggestion doesn't bring much
profit, but instead could lead to potential problems with reclaiming
memory used by direct memory buffers.

I'm going to fix this.

Is there any objections (suggestions)?

Reply | Threaded
Open this post in threaded view
|

Re: Proposal to remove explicit "GC disable" startup suggestion

Valentin Kulichenko
Hi Ilya,

Out of curiosity - what are the potential problems with memory buffers that
you're referring to?

-Val

On Fri, May 14, 2021 at 5:06 AM Ilya Korol <[hidden email]> wrote:

> Hi, everyone.
>
> There is a proposal to remove suggestion that user should disable
> explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720.
>
> Nowadays people usually don't use this facility directly without huge
> need (at least we hope so), so this suggestion doesn't bring much
> profit, but instead could lead to potential problems with reclaiming
> memory used by direct memory buffers.
>
> I'm going to fix this.
>
> Is there any objections (suggestions)?
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to remove explicit "GC disable" startup suggestion

Ivan Daschinsky-2
Hi, Val! Please take a look to java.nio.Bits.reserveMemory (jdk8). In this
method you can see explicit call of System.gc()

вс, 16 мая 2021 г., 01:22 Valentin Kulichenko <[hidden email]
>:

> Hi Ilya,
>
> Out of curiosity - what are the potential problems with memory buffers that
> you're referring to?
>
> -Val
>
> On Fri, May 14, 2021 at 5:06 AM Ilya Korol <[hidden email]> wrote:
>
> > Hi, everyone.
> >
> > There is a proposal to remove suggestion that user should disable
> > explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720.
> >
> > Nowadays people usually don't use this facility directly without huge
> > need (at least we hope so), so this suggestion doesn't bring much
> > profit, but instead could lead to potential problems with reclaiming
> > memory used by direct memory buffers.
> >
> > I'm going to fix this.
> >
> > Is there any objections (suggestions)?
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to remove explicit "GC disable" startup suggestion

Ilya Korol
In reply to this post by Valentin Kulichenko
In some circumstances there could be a state when direct buffers
(instantiated for IO purposes) hold too many memory and to get this
memory back JVM calls System.gc() (as was mentioned earlier by Ivan
Daschinsky):

ByteBuffer.allocateDirect(capacity)
     new DirectButeBuffer(capacity)
         Bits.reserveMemory(size, cap)
...
             System.gc() // if optimistic attempts to reserve required
memory failed

See also:
[1]
http://www.mastertheboss.com/other/java-stuff/troubleshooting-outofmemoryerror-direct-buffer-memory

See

16.05.2021 01:21, Valentin Kulichenko пишет:

> Hi Ilya,
>
> Out of curiosity - what are the potential problems with memory buffers that
> you're referring to?
>
> -Val
>
> On Fri, May 14, 2021 at 5:06 AM Ilya Korol <[hidden email]> wrote:
>
>> Hi, everyone.
>>
>> There is a proposal to remove suggestion that user should disable
>> explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720.
>>
>> Nowadays people usually don't use this facility directly without huge
>> need (at least we hope so), so this suggestion doesn't bring much
>> profit, but instead could lead to potential problems with reclaiming
>> memory used by direct memory buffers.
>>
>> I'm going to fix this.
>>
>> Is there any objections (suggestions)?
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to remove explicit "GC disable" startup suggestion

Valentin Kulichenko
Got it. The proposal makes sense to me, let's remove the suggestion.

-Val

On Sun, May 16, 2021 at 5:50 AM Ilya Korol <[hidden email]> wrote:

> In some circumstances there could be a state when direct buffers
> (instantiated for IO purposes) hold too many memory and to get this
> memory back JVM calls System.gc() (as was mentioned earlier by Ivan
> Daschinsky):
>
> ByteBuffer.allocateDirect(capacity)
>      new DirectButeBuffer(capacity)
>          Bits.reserveMemory(size, cap)
> ...
>              System.gc() // if optimistic attempts to reserve required
> memory failed
>
> See also:
> [1]
>
> http://www.mastertheboss.com/other/java-stuff/troubleshooting-outofmemoryerror-direct-buffer-memory
>
> See
>
> 16.05.2021 01:21, Valentin Kulichenko пишет:
> > Hi Ilya,
> >
> > Out of curiosity - what are the potential problems with memory buffers
> that
> > you're referring to?
> >
> > -Val
> >
> > On Fri, May 14, 2021 at 5:06 AM Ilya Korol <[hidden email]> wrote:
> >
> >> Hi, everyone.
> >>
> >> There is a proposal to remove suggestion that user should disable
> >> explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720
> .
> >>
> >> Nowadays people usually don't use this facility directly without huge
> >> need (at least we hope so), so this suggestion doesn't bring much
> >> profit, but instead could lead to potential problems with reclaiming
> >> memory used by direct memory buffers.
> >>
> >> I'm going to fix this.
> >>
> >> Is there any objections (suggestions)?
> >>
> >>
>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to remove explicit "GC disable" startup suggestion

李玉珏@163
Does the document also need to be adjusted?

https://ignite.apache.org/docs/latest/perf-and-troubleshooting/memory-tuning

在 2021/5/18 上午1:46, Valentin Kulichenko 写道:

> Got it. The proposal makes sense to me, let's remove the suggestion.
>
> -Val
>
> On Sun, May 16, 2021 at 5:50 AM Ilya Korol <[hidden email]> wrote:
>
>> In some circumstances there could be a state when direct buffers
>> (instantiated for IO purposes) hold too many memory and to get this
>> memory back JVM calls System.gc() (as was mentioned earlier by Ivan
>> Daschinsky):
>>
>> ByteBuffer.allocateDirect(capacity)
>>       new DirectButeBuffer(capacity)
>>           Bits.reserveMemory(size, cap)
>> ...
>>               System.gc() // if optimistic attempts to reserve required
>> memory failed
>>
>> See also:
>> [1]
>>
>> http://www.mastertheboss.com/other/java-stuff/troubleshooting-outofmemoryerror-direct-buffer-memory
>>
>> See
>>
>> 16.05.2021 01:21, Valentin Kulichenko пишет:
>>> Hi Ilya,
>>>
>>> Out of curiosity - what are the potential problems with memory buffers
>> that
>>> you're referring to?
>>>
>>> -Val
>>>
>>> On Fri, May 14, 2021 at 5:06 AM Ilya Korol <[hidden email]> wrote:
>>>
>>>> Hi, everyone.
>>>>
>>>> There is a proposal to remove suggestion that user should disable
>>>> explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720
>> .
>>>> Nowadays people usually don't use this facility directly without huge
>>>> need (at least we hope so), so this suggestion doesn't bring much
>>>> profit, but instead could lead to potential problems with reclaiming
>>>> memory used by direct memory buffers.
>>>>
>>>> I'm going to fix this.
>>>>
>>>> Is there any objections (suggestions)?
>>>>
>>>>
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to remove explicit "GC disable" startup suggestion

Steshin Vladimir
In reply to this post by Ilya Korol
Ilya, hi.

+1 from me. We should not worry about weird user actions. Direct calling
of GC looks unusual today. Suggestion of forced disabling manual
System.gc() looks useless.

14.05.2021 15:06, Ilya Korol пишет:

> Hi, everyone.
>
> There is a proposal to remove suggestion that user should disable
> explicit GC calls in https://issues.apache.org/jira/browse/IGNITE-14720.
>
> Nowadays people usually don't use this facility directly without huge
> need (at least we hope so), so this suggestion doesn't bring much
> profit, but instead could lead to potential problems with reclaiming
> memory used by direct memory buffers.
>
> I'm going to fix this.
>
> Is there any objections (suggestions)?
>