[QFJ-861] OutOfMemoryError with using DefaultMessageFactory and quickfixj-all-1.6.1.jar Created: 23/Sep/15  Updated: 22/Dec/15  Resolved: 22/Dec/15

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: 1.6.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Frantisek Hradil Assignee: Unassigned
Resolution: Not a bug Votes: 0
Labels: None

Issue Links:
Relates
is related to QFJ-855 Change packaging strategy for quickfi... Closed

 Description   

Hi,
after upgrade from 1.5.3 to 1.6.1 I got "OutOfMemoryError". I'm using "quickfixj-all-1.6.1.jar". Problem is that "quickfix.DefaultMessageFactory" trying to add all factories (fix40,fix41,..fix50sp2). Problem is during adding "fix50sp2".

I had to use "quickfixj-all-1.6.1.jar" instead of "quickfixj-core-1.6.1.jar" + "quickfixj-messages-fix44-1.6.1.jar" because of issue "QFJ-845".

Please, could you look at it? Is there a plan for release a new quickfixj version?

Thank you.

Error replication:
MessageFactory mf = new DefaultMessageFactory();

More exception details:
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at quickfix.DefaultMessageFactory.addFactory(DefaultMessageFactory.java:85)
at quickfix.DefaultMessageFactory.addFactory(DefaultMessageFactory.java:60)
at quickfix.DefaultMessageFactory.<init>(DefaultMessageFactory.java:54)



 Comments   
Comment by Christoph John [ 23/Sep/15 ]

Seems you'll have to increase the PermGen size then. Or use Java8 and Metaspace.

https://github.com/quickfix-j/quickfixj/wiki/QFJ-1.6.0-release-notes

Edit: QFJ-845 is solved with QFJ 1.6.1. Or did you experience problems?

Comment by Frantisek Hradil [ 23/Sep/15 ]

Hi John,
thank you for your quick answer.

I'm working in a big company, so it's not easy to upgrade to Java8 in tens of our applications. Also it is not so easy to increase memory... (Which value is enough, what do you think?)

Main problem is, that QFJ-845 was solved by the new jar "quickfixj-all-1.6.1.jar". Yes, the problem was solved. But now there is the new memory issue.
I would like to use just the jars, which I need - same as in 1.5.3.

Comment by Christoph John [ 23/Sep/15 ]

Hi, I don't know what the default PermGen setting is on your machine. But I guess somewhere around 64 or 96MB. So increasing to 128MB might already help. But this of course also depends on the classes loaded by your own application, which also go into PermGen.

I think you are referring to QFJ-855 with regard to not being able to use the single message JARs.

Another work-around: in our company we did not need the FIX5.0+ stuff either but wanted a single JAR, so we just built a new JAR only containing the needed FIX message classes for FIX4.0 - 4.4. This can be achieved with the Maven Shade plugin. But I don't know if you are using Maven.

Comment by Frantisek Hradil [ 23/Sep/15 ]

Actually I got the error also with 512MB or 1024MB - so it is really strange...
Yes, using just part of packages from "quickfixj-all-1.6.1.jar" can help - but I'm not so happy with this solution (with changing of released jar manually).

Thank you for your help. I will probably wait with upgrade untill QFJ-855 will be solved and released.

Comment by Christoph John [ 23/Sep/15 ]

Actually I got the error also with 512MB or 1024MB - so it is really strange...

I think that is impossible. I guess the setting does not get picked up by the process. You can find out the current PermGen size by doing e.g. "jmap -heap <pid>" on your process. Are you sure you are setting PermGen size, not heap size?

Comment by Frantisek Hradil [ 23/Sep/15 ]

Omg, my mistake! You are right, I increased just heap size. It works now.
Thank you.

Comment by Christoph John [ 23/Sep/15 ]

No problem

Generated at Sat Nov 23 12:42:02 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.