Saturday, July 22, 2017

Re: MacOs threads limit during GWT compilation

Looks like the number of threads being created is using up stack memory. 
Try reducing the amount of stack memory allocated to each thread on creation. -Xss depending on what JVM you are using try setting it to minimum.

On 22 Jul 2017 17:46, "Mikhail Krestyaninov" <> wrote:

I have a very big GWT project which recently has become a bit more bigger. After a new GWT module was added the following error started to occur:








-classpath "VERY:BIG:CLASSPATH" -superDevMode -style PRETTY -war /Users/username/Library/Caches/IntelliJIdea2017.1/gwt/project.5b9c19f7/Project-gwt.9c4fbf78/run/www -remoteUI 7906:IntelliJIdea com.example.gwt.ProjectEntryPoint com.example.gwt.pages.Pages com.example.gwt.login.LoginPage com.example.gwt.admin.AdminPage

Running CodeServer with parameters: [-noprecompile, -port, 9876, -sourceLevel, 1.8, -bindAddress,, -launcherDir, /Users/username/Library/Caches/IntelliJIdea2017.1/gwt/project.5b9c19f7/Project-gwt.9c4fbf78/run/www, -logLevel, INFO, -style, PRETTY, com.example.gwt.ProjectEntryPoint, com.example.gwt.pages.Pages, com.example.gwt.login.LoginPage, com.example.gwt.admin.AdminPage]

Super Dev Mode starting up

  workDir: /var/folders/pd/1gzkcy4d4md1hcrwmjjbzqrc0000gn/T/gwt-codeserver-7810232587123559115.tmp

Jul 21, 2017 4:09:24 PM org.eclipse.jetty.util.log.JavaUtilLog info

INFO: Logging initialized @3481ms

  Loading Java files in com.example.gwt.ProjectEntryPoint.

  Module setup completed in 49903 ms

  Loading Java files in com.example.gwt.pages.Pages.

  Module setup completed in 2964 ms

  Loading Java files in com.example.gwt.login.LoginPage.

  Module setup completed in 2350 ms

java.lang.OutOfMemoryError: unable to create new native thread

       at java.lang.Thread.start0(Native Method)

       at java.lang.Thread.start(

       at java.util.concurrent.ThreadPoolExecutor.addWorker(

       at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(

       at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(

       at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(

       at java.util.concurrent.Executors$DelegatedScheduledExecutorService.scheduleAtFixedRate(

       at sun.nio.fs.PollingWatchService$PollingWatchKey.enable(

       at sun.nio.fs.PollingWatchService.doPrivilegedRegister(

       at sun.nio.fs.PollingWatchService.access$000(

       at sun.nio.fs.PollingWatchService$

       at sun.nio.fs.PollingWatchService$

       at Method)

       at sun.nio.fs.PollingWatchService.register(

       at sun.nio.fs.UnixPath.register(

       at sun.nio.fs.AbstractPath.register(


















       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       at sun.reflect.NativeMethodAccessorImpl.invoke(

       at sun.reflect.DelegatingMethodAccessorImpl.invoke(

       at java.lang.reflect.Method.invoke(









During the compilation process I can see (in Activity Monitor) that the amount of threads for DevMode process raises up to 2K and then the error occurs. As far as I can see, the default limit of threads per process on MacOS ("sysctl kern.num_taskthreads") is 2048 which means that I hit it. Changing Xmx limit (obviously) doesn't solve the problem.

I tried to decrease the amount of local workers, but faced the following error:

Unknown argument: -localWorkers

Google Web Toolkit 2.8.1

DevMode [-[no]startServer] [-port port-number | "auto"] [-logdir directory] [-logLevel (ERROR|WARN|INFO|TRACE|DEBUG|SPAM|ALL)] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number | "auto"] [-[no]superDevMode] [-server servletContainerLauncher[:args]] [-startupUrl url] [-war dir] [-deploy dir] [-extra dir] [-modulePathPrefix ] [-workDir dir] [-XmethodNameDisplayMode (NONE|ONLY_METHOD_NAME|ABBREVIATED|FULL)] [-sourceLevel [auto, 1.8]] [-[no]generateJsInteropExports] [-includeJsInteropExports/excludeJsInteropExports regex] [-[no]incremental] [-style (DETAILED|OBFUSCATED|PRETTY)] [-[no]failOnError] [-setProperty name=value,value...] module[s]


 -[no]startServer                                  Starts a servlet container serving the directory specified by the -war flag. (defaults to ON)

 -port                                             Specifies the TCP port for the embedded web server (defaults to 8888)

 -logdir                                           Logs to a file in the given directory, as well as


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment