Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2017 08:35:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        java@FreeBSD.org
Subject:   [Bug 223589] [PATCH] java/openjdk8: support setting thread name in OpenJDK8
Message-ID:  <bug-223589-8522@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223589

            Bug ID: 223589
           Summary: [PATCH] java/openjdk8: support setting thread name in
                    OpenJDK8
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: java@FreeBSD.org
          Reporter: bra@fsn.hu
          Assignee: java@FreeBSD.org
             Flags: maintainer-feedback?(java@FreeBSD.org)
          Keywords: patch

Created attachment 187902
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D187902&action=
=3Dedit
openjdk8 thread name patch

The following patch makes OpenJDK8 able to set threads' native name, which =
is
quite useful for debugging which thread uses resources.
Before the patch you can see this in top:
43720 tomcat         20    0 11563M  9233M kqread  7   1:12   0.45% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread  8   1:17   0.45% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread  5   1:09   0.44% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread 15   1:19   0.44% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread 16   0:58   0.44% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread  6   1:15   0.44% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread  3   1:16   0.43% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread 12   1:15   0.43% java{ja=
va}
43720 tomcat         20    0 11563M  9233M kqread 18   1:24   0.40% java{ja=
va}
after the patch:
46396 tomcat          21    0  7228M  1004M uwait   3   0:46   7.80% java{C2
CompilerThread1}
46396 tomcat          20    0  7228M  1004M uwait   2   0:49   2.73% java{C2
CompilerThread0}
46396 tomcat          20    0  7228M  1004M uwait   0   0:42   1.83%
java{qtp927744186-64}
46396 tomcat          20    0  7228M  1004M select  1   0:03   0.01% java{A=
MQP
Connection 0:0}
46349 tomcat          20    0  7005M   816M kqread  1   0:02   0.00%
java{pool-7-thread-1}
46396 tomcat          20    0  7228M  1004M kqread  0   0:09   0.10%
java{lettuce-nioEventLoo}

According to thr_set_name(2), the thread's name can be maximum 19 characters
(MAXCOMLEN + 1 bytes), we'll give a buffer of that size just to be sure.
The MacOS code prefixes everthing with "Java", but it's totally useless (as=
 can
be seen above, just eats valuable space), so use only the name which is giv=
en
by the caller.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223589-8522>