Garbage Collecition in GO

175 views
Skip to first unread message

Chris Tamlyn

unread,
May 19, 2016, 3:56:55 AM5/19/16
to go-cd, chris....@bridgeinternationalacademies.com
We started to get an error in GO around Garabge collection which directs us to this link:


Has anyone else implemented this in Go before?  I'm not sure that I'm reading the documentation correctly on how to set it up for GO.  I've read it as you need to add those properties to your 'wrapper-properties' file (we run on Windows).  So I've added the following 3 settings:

go.config.repo.gc.periodic=Y
go.config.repo.gc.aggressive=Y
go.config.repo.gc.cron=0 0 7 ? * SUN

But I wasn't sure if this was the correct place of if they should be Windows Environment variables.  Has anyone got any experience setting this up and could help guide us?

Many Thanks

Chris

Varsha Varadarajan

unread,
May 23, 2016, 11:42:04 PM5/23/16
to go-cd, chris....@bridgeinternationalacademies.com
Hi Chris

The above properties that you mentioned are system properties that alter how the garbage collection behaviour in the configuration repository. They must be added to the wrapper-properties.conf file. 


Make sure you restart the Go server after changing the same.

Thanks.
Varsha

Chris Tamlyn

unread,
May 24, 2016, 4:27:20 AM5/24/16
to go-cd, chris....@bridgeinternationalacademies.com
Thanks Varsha, sounds like we did everything right then.  I don't see that any garbage collection occurred at the scheduled time and we still have the error reporting in the GUI.  So not sure how to explain that.

keithl...@gmail.com

unread,
Aug 28, 2017, 8:28:12 PM8/28/17
to go-cd, chris....@bridgeinternationalacademies.com
I have the same issue and am not able to get the setting to work.  I use https://<your-server>:8154/go/api/support  to verify if the properties but did not see the properties.  
Anyone has the answer please share.   I am on MS Windows as well. 


Thanks,
Keith

Ketan Padegaonkar

unread,
Aug 28, 2017, 9:43:16 PM8/28/17
to go-cd, chris....@bridgeinternationalacademies.com

See this page (https://docs.gocd.org/current/installation/install/server/windows.html#overriding-default-startup-arguments-and-environment) for details on setting up system properties.


--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

keithl...@gmail.com

unread,
Aug 29, 2017, 12:27:14 PM8/29/17
to go-cd, chris....@bridgeinternationalacademies.com
Thanks Ketan,

I used the instruction and did these steps, must have missed something subtle.

1) in <go server>\config\wrapper-server.conf
un-commented the line 
#include config/wrapper-properties.conf
to 
include config/wrapper-properties.conf

2) created a new file wrapper-properties.conf 
with the following content:

tried 
1) 
wrapper.java.additional.16=-Dgo.config.repo.gc.periodic=Y
wrapper.java.additional.17=-Dgo.config.repo.gc.cron='0 0 3 * * *'

1b) with double quotes
wrapper.java.additional.16="-Dgo.config.repo.gc.periodic=Y"
wrapper.java.additional.17="-Dgo.config.repo.gc.cron='0 0 3 * * *'"

1c) (with escape key?)
wrapper.java.additional.16="-Dgo.config.repo.gc.periodic=Y"
wrapper.java.additional.17="-Dgo.config.repo.gc.cron='0 0 3 \* \* \*'"

2) 
go.config.repo.gc.periodic=Y
go.config.repo.gc.cron='0 0 3 * * *'

None of the above works for me.  Must be something subtle. 

Any help appreciated,

Thanks,
Keith

Ketan Padegaonkar

unread,
Aug 29, 2017, 12:29:36 PM8/29/17
to go...@googlegroups.com
Would you mind logging an issue on github with the contents of your wrapper-server.conf file so someone can take a look?

Aravind SV

unread,
Aug 29, 2017, 12:37:30 PM8/29/17
to go...@googlegroups.com
You shouldn't remove the "#" before the "#include". Though the rest of the lines prefixed with a "#" are comments, in the case of the include directive, it is: "#include", as you can see here: https://wrapper.tanukisoftware.com/doc/english/props-cascading.html

If you create the file config/wrapper-properties.conf and try one of the options (Option 1, I think) that you mentioned, it should work.

To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+unsubscribe@googlegroups.com.

Ketan Padegaonkar

unread,
Aug 29, 2017, 12:45:21 PM8/29/17
to go...@googlegroups.com
On Tue, Aug 29, 2017 at 10:07 PM Aravind SV <arv...@thoughtworks.com> wrote:
You shouldn't remove the "#" before the "#include". Though the rest of the lines prefixed with a "#" are comments, in the case of the include directive, it is: "#include", as you can see here: https://wrapper.tanukisoftware.com/doc/english/props-cascading.html

Gah! Perhaps we need to add a comment to that file to avoid someone tripping on the same thing... 

keithl...@gmail.com

unread,
Aug 29, 2017, 3:04:50 PM8/29/17
to go-cd
Thank you Ketan and Aravind,

With the #include directive in place, the final version that works is (note the double quotes) as below. 

wrapper.java.additional.16=-Dgo.config.repo.gc.periodic=Y
wrapper.java.additional.17=-Dgo.config.repo.gc.cron="0 0 3 * * ?"

So the confusion here is that, the sample showing cron with escape characters wrapped in single quotes and outer double quotes, when that did not work and the general eventlog error of (The Go Server service terminated with the following service-specific error: Incorrect function. was such that wrong function used), I went down the wrong path of the uncommenting #include. 

Anyway, thanks for the quick reply and the help you gave me here.

Appreciatively,
Keith

keithl...@gmail.com

unread,
Aug 29, 2017, 3:43:26 PM8/29/17
to go-cd
Also an added quirkiness, with the below content, only the go.config.repo.gc.cron  property is persisted but not the go.config.repo.gc.periodic property.  I added a comment line at the very top of the file and it works.

Chris Tamlyn

unread,
Aug 30, 2017, 4:01:13 AM8/30/17
to go-cd
Once you set the config as above, do you see the settings in https://<your-server>:8154/go/api/support?

I've followed your steps (I think) but just trying to verify if the settings are being read by the server.  I don't seem to see anything on the support page.

thanks

Chris

keithl...@gmail.com

unread,
Aug 30, 2017, 2:35:51 PM8/30/17
to go-cd
Yes, I see them in the support page:  see blue text below.

 "Runtime Information": {
    "Name": "4808@SEAPRODMGMT01",
    "Uptime": 314474,
    "Uptime (in Time Format)": "[About 0 hours, 5 minutes, 14 seconds]",
    "Spec Name": "Java Virtual Machine Specification",
    "Spec Vendor": "Oracle Corporation",
    "Spec Version": "1.8",
    "Input Arguments": [
      "-Xms512m",
      "-Xmx1024m",
      "-DreservedForFuture.6",
      "-XX:MaxMetaspaceSize\u003d256m",
      "-Duser.language\u003den",
      "-Duser.country\u003dUS",
      "-Dcruise.config.dir\u003de:\\Go\\Server\\config",
      "-Dcruise.config.file\u003de:\\Go\\Server\\config\\cruise-config.xml",
      "-DreservedForFuture.1",
      "-DreservedForFuture.2",
      "-DJAVA_SYS_MON_TEMP_DIR\u003de:\\Go\\Server\\tmp",
      "-Dno_debugging",
      "-Dno_gc_logging",
      "-DreservedForFuture.4",
      "-DreservedForFuture.5",
      "-Dgo.config.repo.gc.periodic\u003dY",
      "-Dgo.config.repo.gc.cron\u003d0 0 3 * * ?",
      "-Dfile.encoding\u003dCp1252",
      "-Djava.library.path\u003dlib",
      "-Dwrapper.key\u003dw22wjMY8wrExwALygeNX6010A04i0LT0",
      "-Dwrapper.port\u003d32000",
      "-Dwrapper.jvm.port.min\u003d31000",
      "-Dwrapper.jvm.port.max\u003d31999",
      "-Dwrapper.pid\u003d5000",
      "-Dwrapper.version\u003d3.5.30-st",
      "-Dwrapper.native_library\u003dwrapper",
      "-Dwrapper.arch\u003dx86",
      "-Dwrapper.service\u003dTRUE",
      "-Dwrapper.cpu.timeout\u003d10",
      "-Dwrapper.jvmid\u003d1",
      "-Dwrapper.lang.domain\u003dwrapper",
      "-Dwrapper.lang.folder\u003d../lang"
    ],
    "System Properties": {
      "JAVA_SYS_MON_TEMP_DIR": "e:\\Go\\Server\\tmp",
      "awt.toolkit": "sun.awt.windows.WToolkit",
      "com.microsoft.tfs.jni.native.base-directory": "e:\\Go\\Server\\data\\tfs-sdk\\tfssdk\\native",
      "cruise.config.dir": "e:\\Go\\Server\\config",
      "cruise.config.file": "e:\\Go\\Server\\config\\cruise-config.xml",
      "file.encoding": "Cp1252",
      "file.encoding.pkg": "sun.io",
      "file.separator": "\\",
      "go.config.repo.gc.cron": "0 0 3 * * ?",
      "go.config.repo.gc.periodic": "Y",
      "java.awt.graphicsenv": "sun.awt.Win32GraphicsEnvironment",

Chris Tamlyn

unread,
Aug 31, 2017, 4:01:44 AM8/31/17
to go-cd, chris....@bridgeinternationalacademies.com
Since I raised this issue we've actually switched to a Linux server so the mechanism is slightly different.  When I view my support page I see:

      "-Dgo.config.repo.gc.periodic\u003dY",
      "-Dgo.config.repo.gc.cron\u003d0 0 7 1/1 \\* \\?",

Which makes me think I've got an issue with escape characters, as yours looks like a real cron expression.

I followed the doc's with their comments on escaping special characters

(added to /etc/defaults/go-server):

GO_SERVER_SYSTEM_PROPERTIES="$GO_SERVER_SYSTEM_PROPERTIES -Dgo.config.repo.gc.periodic=Y -Dgo.config.repo.gc.cron='0 0 7 1/1 \* \?'" 

Ketan Padegaonkar

unread,
Aug 31, 2017, 4:29:47 AM8/31/17
to go...@googlegroups.com
On Thu, Aug 31, 2017 at 1:31 PM Chris Tamlyn <chris...@gmail.com> wrote:
Since I raised this issue we've actually switched to a Linux server so the mechanism is slightly different.  When I view my support page I see:

      "-Dgo.config.repo.gc.periodic\u003dY",
      "-Dgo.config.repo.gc.cron\u003d0 0 7 1/1 \\* \\?",
Those are CLI args string escaped. You probably need to look at the section under "System Properties" to see the unescaped values and see if they are valid expressions understood by quartz (http://www.quartz-scheduler.org/api/2.2.1/org/quartz/CronExpression.html)

I'm seeing this on the build server at build.gocd.org:

$ curl -s -uUSER:PASS https://build.gocd.org/go/api/support | jq '.["Runtime Information"]["System Properties"]["go.config.repo.gc.cron"]'
"0 0 7/12 1/1 * ?"

The file /etc/default/go-server contains:

export GO_SERVER_SYSTEM_PROPERTIES="-Dgo.config.repo.gc.periodic=true -Dgo.config.repo.gc.cron='0 0 7/12 1/1 * ?' -Dgo.config.repo.gc.expire=10"

Chris Tamlyn

unread,
Aug 31, 2017, 7:52:17 AM8/31/17
to go-cd
thanks.  Looks better on the support pages now.  Let's see what happens at  7am.
Reply all
Reply to author
Forward
0 new messages