JDK-6728845 : Extremely slow, quadratic performance with very long command lines
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux
  • CPU: x86
  • Submitted: 2008-07-23
  • Updated: 2017-02-09
  • Resolved: 2017-02-09
Description
FULL PRODUCT VERSION :
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)


FULL OS VERSION :
Linux stinkpad 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
The JVM starts very slowly if given a large number of arguments.  For example, with 68000 arguments totaling about 2MB of text, the JVM requires 44 seconds to start, before it even enters main().  On the same machine, the JVM starts with 4500 arguments (~128KB) in 900 milliseconds.  It appears that the startup behavior of the JVM is superlinear with respect to the length of the command line.

On many Unix systems the command line is limited to 128KiB but on Linux the limit was recently raised to 2GiB.  You will need to use a recent Linux system to reproduce this problem.

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java `seq 1 100000`

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected result: JVM startup time is linear as number and length of command line increases.
Actual result: JVM startup time is superlinear as command line increases in length.
REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Workaround: use xargs(1) to limit command line length.

Comments
After 8 years this has not been an issue. Closing.
09-02-2017