Skip to content

LinkedCaseInsensitiveMap not getting garbage collected and creating out of memory server crash in WAS-8 [SPR-9910] #14543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Oct 23, 2012 · 5 comments
Assignees
Labels
status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link
Collaborator

pramod p opened SPR-9910 and commented

Our application was working fine on spring 2.5 and Websphere-6.X .We upgraded to Spring 3.1.1 and WAS-8.X recently.After that we having server crashed due to out of memory error,due to the LinkedCaseInsensitiveMap are not getting garbage collected.I mean it not gettin de-referenced even after use.Below is the response from IBM.

After several attempts at analyzing the heapdump, I think I finally
succeeded. There is a 5 million element array containing only
org.springframework objects, and it's also holding onto approximately 6
GB of the heap.

========================================================================
Class_Name@Address  Shallow_Heap  Retained_Heap
java.util.ArrayList @ 0x9d503d50 24 5,897,305,288 bytes
java.lang.Object[6463408] @ 0x1628fc220 25,853,648 5,897,305,264 bytes
  org.springframework.util.LinkedCaseInsensitiveMap @ 0x4d61c968 64 1,152
  org.springframework.util.LinkedCaseInsensitiveMap @ 0xf6b8c050 64 1,152
  org.springframework.util.LinkedCaseInsensitiveMap @ 0xecfcd938 64 1,152
  org.springframework.util.LinkedCaseInsensitiveMap @ 0xdaa35b00 64 1,152
  org.springframework.util.LinkedCaseInsensitiveMap @ 0xf1c64ea8 64 1,152
...
...
...
========================================================================

I'm not familiar with this array or what SpringFramework uses it for,
but it's the root cause of the out of memory. So far looking inside
the objects I've found primitive variables as well as hashmaps.

Looking up the API for SpringFramework, it seem this is simply a
hashmap that stores String keys and preserves the original order. The
javacores that we have for this PMR does not show direct access to
these objects, but I know SpringFramework is being used behind the
scenes in your application.

Talk to your application developers or contact your vendor concerning
these calls, as something has to release data from this hashmap, but it
appears not to be doing that.


Affects: 3.1.1

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 24, 2012

Phil Webb commented

pramod p Out of interest are you using XML or @Configuration beans? We recently fixed #14484 which may or may not be related to this issue.

@spring-projects-issues
Copy link
Collaborator Author

pramod p commented

Hi Phill,

Thanks for looking into this issue.We are using XML for the bean configuration.We never had this issue with spring 2.5.I have checked once again with IBM and they confirm that the GC setting is correct for WebSphere and issue is that these objects are not getting de-referenced to make it eligible for GC. Do you think this has got any relation with the way we configure the DB trasactions (we use declarative)? .Please advice.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

The key question is: Who holds on to those objects? We use them in several places but usually just as temporary return values. I wonder whether we're using them as a key in a static cache somewhere now?

Juergen

@spring-projects-issues
Copy link
Collaborator Author

pramod p commented

Thanks for the reply.

We are not referencing or using the LinkedCaseInsensitiveMap expilicitly from our code.It is used in the Spring side to return the result.

Our code have Below type of statements to fetch the results from DB (Normal JDBC calls)

List dbResults = getMdmService().getDaoService().getMdmCommonJdbcDao().queryForResults(query, new ColumnMapRowMapper(), null); 

which in turn calls the below :-

resulSet = (List) getJdbcTemplate().query(creator, extractor);

But some how the data in the LinkedCaseInsensitiveMap (fetched results from DB) is not getting eligible for GC.

Please advice .

@spring-projects-issues
Copy link
Collaborator Author

pramod p commented

Hi All,

Thanks for all the support for checking the issue.After a lot of analysis we cornered the issue to the third party export frame work we are using for the exports.We are working on that to solve the issue.Thanks once again for the support.It was very important for us as the product was live in production.

@Juergen Hoeller ,@Chris Beams Can you please close or reject the issue as it is not related to Spring framework.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: invalid An issue that we don't feel is valid labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants