make/RunTests.gmk
changeset 59120 fc68b2cdfeeb
parent 58754 f67f4674b466
equal deleted inserted replaced
59119:7bdc4f073c7f 59120:fc68b2cdfeeb
   245       CORES_DIVIDER := 5
   245       CORES_DIVIDER := 5
   246     else
   246     else
   247       CORES_DIVIDER := 4
   247       CORES_DIVIDER := 4
   248     endif
   248     endif
   249   endif
   249   endif
       
   250   # For some big multi-core machines with low ulimit -u setting we hit the max
       
   251   # threads/process limit. In such a setup the memory/cores-only-guided
       
   252   # TEST_JOBS config is insufficient. From experience a concurrency setting of
       
   253   # 14 works reasonably well for low ulimit values (<= 4096). Thus, use
       
   254   # divider 4096/14. For high ulimit -u values this shouldn't make a difference.
       
   255   ULIMIT_DIVIDER := (4096/14)
       
   256   PROC_ULIMIT := -1
       
   257   ifneq ($(OPENJDK_TARGET_OS), windows)
       
   258     PROC_ULIMIT := $(shell $(ULIMIT) -u)
       
   259     ifeq ($(PROC_ULIMIT), unlimited)
       
   260       PROC_ULIMIT := -1
       
   261     endif
       
   262   endif
   250   MEMORY_DIVIDER := 2048
   263   MEMORY_DIVIDER := 2048
   251   TEST_JOBS := $(shell $(AWK) \
   264   TEST_JOBS := $(shell $(AWK) \
   252     'BEGIN { \
   265     'BEGIN { \
   253       c = $(NUM_CORES) / $(CORES_DIVIDER); \
   266       c = $(NUM_CORES) / $(CORES_DIVIDER); \
   254       m = $(MEMORY_SIZE) / $(MEMORY_DIVIDER); \
   267       m = $(MEMORY_SIZE) / $(MEMORY_DIVIDER); \
       
   268       u = $(PROC_ULIMIT); \
       
   269       if (u > -1) { \
       
   270         u = u / $(ULIMIT_DIVIDER); \
       
   271         if (u < c) c = u; \
       
   272       } \
   255       if (c > m) c = m; \
   273       if (c > m) c = m; \
   256       c = c * $(TEST_JOBS_FACTOR); \
   274       c = c * $(TEST_JOBS_FACTOR); \
   257       c = c * $(TEST_JOBS_FACTOR_JDL); \
   275       c = c * $(TEST_JOBS_FACTOR_JDL); \
   258       c = c * $(TEST_JOBS_FACTOR_MACHINE); \
   276       c = c * $(TEST_JOBS_FACTOR_MACHINE); \
   259       if (c < 1) c = 1; \
   277       if (c < 1) c = 1; \