0

I have a FIX application which receives FIX MarketData messages and sends them to inner applications. I disabled MarketData logging since it's generating extremely large logs but we have the same problem for stores. When I look at a heap dump, I see that there's TreeMap groving continously. Most probably the TreeMap is the one in the FileStore.
What do people do in such cases?
Thanks

xyzt
  • 1,201
  • 4
  • 18
  • 44

1 Answers1

0
  1. Create a class CustomFileStore which implements the MessageStore interface. Make a constructor taking a MessageStore object and store it as a member. Delegate all methods in the MessageStore interface to the MessageStore member, except for the set method. In your implementation of the set method filter messages: if it's a MarketData message do nothing, else call set on the MessageStore member.
  2. Create a class CustomFileStoreFactory deriving from FileStoreFactory, and override the create method. In the create method, create a CustomFileStore passing the constructor the return from super.create (which would be a FileStore object).
  3. Pass an instance of CustomFileStoreFactory to your SocketInitiator.

Note that this is rather hacky and I would not do this myself unless there is no other way (I have never done this myself). If MessageStore.get is called on the CustomFileStore, it might result in unexpected behaviour (exceptions, or incorrect results). So I would advise against doing this.

TT.
  • 15,774
  • 6
  • 47
  • 88