You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sis.apache.org by "Martin Desruisseaux (Jira)" <ji...@apache.org> on 2026/08/29 09:14:00 UTC

[jira] [Resolved] (SIS-637) EPSGFactory triggers full GCs

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

Martin Desruisseaux resolved SIS-637.
-------------------------------------
    Fix Version/s: 1.7
       Resolution: Fixed

Thanks for reporting. I removed the call to {{{}System.gc(){}}}. Note: it was invoked not only for cleaning weak references, but because those cleanings were taken as an indication that we can release JDBC resources. Resources may be retained for a longer time with this change.

Also changed the time before retry from 10 seconds to 1 minute.

> EPSGFactory triggers full GCs
> -----------------------------
>
>                 Key: SIS-637
>                 URL: https://issues.apache.org/jira/browse/SIS-637
>             Project: Spatial Information Systems
>          Issue Type: Bug
>    Affects Versions: 1.5, 1.6
>            Reporter: Corey Puffalt
>            Assignee: Martin Desruisseaux
>            Priority: Major
>             Fix For: 1.7
>
>
> In an application using Apache SIS we noticed full garbage collections being triggered every 10 seconds. This traces to {{{}EPSGDataAccess.canClose(){}}}, which calls {{System.gc()}} whenever its {{authorityCodes}} map is non-empty, combined with the 10 second timeout {{EPSGFactory}} sets in its constructor.  Strongly recommend the {{System.gc()}} call be removed completely.  I understand it's trying to ensure some weak references are cleared but we should trust the JVM here.  Running full GCs every 10s adds a LOT of load for applications with larger heap sizes and causes noticeable pauses on multi-user web applications.  Yes, this can be mitigated by completely disabling full GCs via {{-XX:+DisableExplicitGC}} but this requires someone to discover the problem first.
> The other cause was on our side due to retaining the Set returned by getAuthorityCodes() rather than copying the values (missed the warning in the javadoc). We will fix this but regardless these full GCs should really go since there's no warning or backoff.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)