Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

tester: OutOfMemoryError: unable to create new native thread X no ticks
 Post subject: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 0   New post Posted: Wed 12 Mar, 2014, 11:04 

User rating: 1
Joined: Mon 27 Feb, 2012, 22:49
Posts: 119
Location: Czech Republic,
If I in tester (JForex) subscribe a lot of instruments (20 - 35) I often get this exception: OutOfMemoryError: unable to create new native thread.

But my system has a lot of free memory. I use method context.setSubscribedInstruments( subinstruments, true ).

After this problem strategy often stand at the end of OnStart method and don't receive any ticks from tester. I have a message on the first several ticks.

What is wrong?

Thanks for help

Lifon


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 0   New post Posted: Wed 12 Mar, 2014, 18:51 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Try to increase Java heap size: https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=42291


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 0   New post Posted: Wed 12 Mar, 2014, 18:56 

User rating: 1
Joined: Mon 27 Feb, 2012, 22:49
Posts: 119
Location: Czech Republic,
hebasto wrote:


I have heap size max 999 M, but strategy use less than 400 M.


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 0   New post Posted: Tue 18 Mar, 2014, 15:02 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Which java version are you using?


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 0   New post Posted: Wed 26 Mar, 2014, 19:46 

User rating: 1
Joined: Mon 27 Feb, 2012, 22:49
Posts: 119
Location: Czech Republic,
tcsabina wrote:
Which java version are you using?


JavaSE 1.7 and JRE 1.1.


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 2   New post Posted: Tue 01 Apr, 2014, 16:59 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
Are you running within Linux?
If so post the output of these commands:

ulimit -a
cat /proc/sys/kernel/threads-max


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 0   New post Posted: Wed 02 Apr, 2014, 06:24 

User rating: 1
Joined: Mon 27 Feb, 2012, 22:49
Posts: 119
Location: Czech Republic,
CriticalSection wrote:
Are you running within Linux?..

I use Windows Web Server.


 
 Post subject: Re: tester: OutOfMemoryError: unable to create new native thread X no ticks Post rating: 2   New post Posted: Wed 02 Apr, 2014, 23:34 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
I'm afraid as a Linux specialist I'm unable to delve deep into Windows Thread Tuning but my initial perspective is that the JFX Tester must have undergone testing during development for behaviour under high instrument subscriptions and not generated any specific issues using a default vanilla installation of Windows running against the cited minimum hardware profile of Java 1.6+, CPU 1.5 GHz+ and RAM 1Gb.

However, you have already introduced modifications to your installation by setting your heap to 999M. You didn't say how much physical RAM you have nor your specific version of Microsoft Windows which are both critical omissions. Also, how many threads are already active when you get this exception? Check the "Threads" tab in the JConsole (jconsole <java-process-id> if you're on the command line).

Based on my understanding of Windows fundamentals, I'm leaning towards a Java solution to your problem (unlike the suspicions I had in the Linux case) so take a look at the following page and consider the diagram there:

Get started with java JVM memory

Are you starving the Permanent area by setting a heap that is too big while also demanding a lot of thread/stack resource?

Read the section And EveryThing Else... closely, especially the part about Thread Stacks.

The .jnlp file used to start the platform can be used to adjust heap and thread stack sizes, etc but you can begin your investigation by reducing your max heap back down to 512MB (given your 400MB observation cited above) and look for any change in symptoms.

Beyond this refer to this reference JNLP File Syntax to get up to speed on how to set (reduce) the thread stack size should you find you need to as a last resort.

An example would look something like this:

<java version="1.6+" initial-heap-size="32m" max-heap-size="512m" java-vm-args="-XX:ThreadStackSize=512"/>

Hope this helps.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com