Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by iscas.wang · Sep 09, 2020 at 09:29 AM · elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apimemory

callback RefreshMsg/UpdateMsg size

Hell, everyone, is there any method to know the size of RefreshMsg or UpdateMsg object ?

Currently in onRefreshMsg & onUpdateMsg, I will create a new object using new operator and push back into an internal queue that has no size limit that will be popped by a decoder thread for processing. But on market open time, the queue will soon filled with many messages and consumes much memory with 1 minute due to speed unmatch between callback thread and decoder thread. Even though 1 minutes later, the decoder consumes message in the queue, the memory of deleted message will still reside in the application, unable to be released to operating system.

One method is to increase decoder thread. But my puzzle is If i increase decoder thread count, due to message wil be hashed into queue via ric, but different ric may comes with different message count, which may cause certain queue filled with messages faster than corresponding decoder can process.

So how should I resolve this problem ?

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Gurpreet · Sep 10, 2020 at 02:07 PM

Yes, the OMM message is usually decoded in the callback event. Once decoded, you can push the blob into the queue for further processing.

You will still have to keep callback event loop as concise as possible, or else ADS might drop the connection due to slow consumer. The best approach is to subscribe to a limited set of fields required by your application, by using the view feature of the SDK. See this article on how to use views - https://developers.refinitiv.com/article/elektron-messaging-api-java-batch-and-view-features

Also see 360__MarketPrice__View shipped with SDK on how to use views.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Gurpreet · Sep 09, 2020 at 02:12 PM

Hi @wangfugen,

You didn't specify which language you are using, and also which objects (OMM or language-custom-structures) you are creating for reading the market data. Either way, it is quite inefficient for a very high throughput system to create and destroy/GC old objects. The best approach in this regards will be to create a pool of objects once and reuse them over and over again. The pool objects can be created once at the beginning or upon market event - when no more objects are available in the pool.

I must point out that even with this approach, your application will eventually run of of memory, if your decoder thread is slow. It is best to optimize the code to run as fast as possible. Usual tips for doing so are - eliminate logging, don't use string manipulation and reduce/avoid any IO blocking operations like network/database etc.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by iscas.wang · Sep 10, 2020 at 02:16 AM

Hi, @Gurpreet, Thanks for your reply. I am using C++ EMA SDK, trying to pass RefreshMsg and UpdateMsg object received from callback functions onRefreshMsg & onUpdateMsg to decoder threads via an internal queue by creating new object using C++ operator new. Then if message is processed by decoder thread, it will be deleted via delete operator.

The problem with RefreshMsg & UpdateMsg is that user has no idea about its structure, I don't know how to preallocate pool of such objects before market open. Maybe I should decode the message in callback thread into my custom structure, storing it into object pool and using that object in decoder thread ?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
7 People are following this question.

Related Questions

EMA CPP - Exception adding ric into OmmArray

Java out of memory error in batch application

EMA OmmConsumer memory leak in Java API?

EMA Java: "channel out of buffers errorId=-4" error with over 3,000 RICs

(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges