Re: [Quickfix-developers] FileStore does not close files in Java wrapper
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2006-06-06 16:45:32
|
This sounds like a similar issues we had with the .NET API. We need to make those objects disposable so we can free up the resources in a timely manner. --oren On Jun 4, 2006, at 10:00 PM, Yong-Jhen Hong wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/ > html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Hi all, > > I maintain an application that uses quickfix Java wrapper to connect > to a trading server, that program is expected to run 24 hours per day, > actually, it is implemented as a Windows service. > > My problem is, the FileStore objects I use never close the four > session > files, hence the program cannot create a new session (and an usable > FileStore object) every morning. After tracing the source, I find it > might be a garbage collection issue, which is similar to bug#192: > http://www.quickfixengine.org/bugtracker/bug.php?op=show&bugid=192 > > It is my point of view that depending on garbage collection (i.e, > the finalize() method) to do necessary cleanup is not a good thing. > Currently, I have a patch that do cleanup explicitly. But now the > initiator still don't establish session with the server correctly, > it continuously sends logout message instead. > > May anyone have similar usage scenario, or insight with this issue, > give my some suggestion? > My patch is also attached with this mail. > > Regards, > yongjhen > > diff -r quickfix-1.11.1\src\java\JavaMessageStore.cpp > quickfix-1.11.1-patch\src\java\JavaMessageStore.cpp > 66c66,71 > < JavaMessageStore::~JavaMessageStore() > { messageStore.deleteGlobalRef(); } > --- >> JavaMessageStore::~JavaMessageStore() { >> jmethodID destroyID = messageStore.getClass().getMethodID >> ( "destroy", "()V" ); >> if (destroyID != NULL) >> ENV::get()->CallVoidMethod(messageStore, destroyID); >> messageStore.deleteGlobalRef(); >> } > diff -r quickfix-1.11.1\src\java\quickfix_SocketInitiator.cpp > quickfix-1.11.1-patch\src\java\quickfix_SocketInitiator.cpp > 116,117c116,117 > < delete &p ->getApplication(); > < delete &p ->getMessageStoreFactory(); > --- >> FIX::Application* app = &p ->getApplication(); >> FIX::MessageStoreFactory* msf = &p ->getMessageStoreFactory(); > 118a119,120 >> delete msf; >> delete app; > diff -r quickfix-1.11.1\src\java\src\quickfix\CppMessageStore.java > quickfix-1.11.1-patch\src\java\src\quickfix\CppMessageStore.java > 61c61 > < private native void destroy(); > --- >> public native void destroy(); > diff -r quickfix-1.11.1\src\java\src\quickfix\FileStore.java > quickfix-1.11.1-patch\src\java\src\quickfix\FileStore.java > 37d36 > < destroy(); > 41c40 > < private native void destroy(); > --- >> public native void destroy(); > diff -r quickfix-1.11.1\src\java\src\quickfix\MemoryStore.java > quickfix-1.11.1-patch\src\java\src\quickfix\MemoryStore.java > 37d36 > < destroy(); > 41c40 > < private native void destroy(); > --- >> public native void destroy(); > diff -r quickfix-1.11.1\src\java\src\quickfix\MSSQLStore.java > quickfix-1.11.1-patch\src\java\src\quickfix\MSSQLStore.java > 37d36 > < destroy(); > 41c40 > < private native void destroy(); > --- >> public native void destroy(); > diff -r quickfix-1.11.1\src\java\src\quickfix\MySQLStore.java > quickfix-1.11.1-patch\src\java\src\quickfix\MySQLStore.java > 37d36 > < destroy(); > 41c40 > < private native void destroy(); > --- >> public native void destroy(); > diff -r quickfix-1.11.1\src\java\src\quickfix\PostgreSQLStore.java > quickfix-1.11.1-patch\src\java\src\quickfix\PostgreSQLStore.java > 37d36 > < destroy(); > 41c40 > < private native void destroy(); > --- >> public native void destroy(); > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |