简体   繁体   English

如何在64位JVM上运行TeamCity

[英]How to run TeamCity on 64-bit JVM

I've just found out that TeamCity runs on the 32-bit JVM on Windows, for some reason. 我刚刚发现TeamCity在Windows上运行在32位JVM上,出于某种原因。

I'm seeing memory errors logged when checking out a large (not that large) Git repo and am already at the max heap size for the JVM. 我在看到一个大的(不是那么大的)Git仓库并且已经处于JVM的最大堆大小时,看到了内存错误。 I know nothing about Java or the JVM, or TomCat. 我对Java或JVM或TomCat一无所知。

How can I run TeamCity on a modern, 64-bit JVM? 如何在现代的64位JVM上运行TeamCity? I sense its going to be a pain, else it would be the default. 我觉得它会很痛苦,否则就会失败。

We're a tiny team and if something doesn't have Apple levels of 'it just works' then we skip it. 我们是一个很小的团队,如果某些东西没有苹果级别的'它只是有效',那么我们跳过它。

We can live with this one project not be on the CI server, but it would be nice to know what's involved and weigh up the investment. 我们可以忍受这个不在CI服务器上的项目,但是知道所涉及的内容并权衡投资会很好。

Any advice appreciated. 任何建议表示赞赏

Edit 编辑

Okay so Markus pointed to this snippet (which I had read), but I can't see any information there explaining what to do. 好吧,马库斯指出了这个片段(我已经读过),但我看不到有任何信息可以解释该怎么做。

Using 64 bit Java to Run TeamCity Server TeamCity can run under both 32 and 64 bit JVM. 使用64位Java运行TeamCity Server TeamCity可以在32位和64位JVM下运行。 It is recommended to use 32 bit JVM unless you need to dedicate more than 1.3Gb of memory to the TeamCity process. 建议使用32位JVM,除非您需要为TeamCity进程提供超过1.3Gb的内存。

If you choose to use x64 JVM please note that the memory usage is almost doubled when switching from 32 to 64 bit JVM, so please make sure you specify at least twice as much memory as for 32 bit JVM, see Setting Up Memory settings for TeamCity Server. 如果您选择使用x64 JVM,请注意从32位JVM切换到64位JVM时内存使用率几乎翻倍,因此请确保至少指定两倍于32位JVM的内存,请参阅为TeamCity设置内存设置服务器。

If you run TeamCity as a service and switch to x64 bit, you will also need to use x64 Tomcat executables, see more. 如果将TeamCity作为服务运行并切换到x64位,则还需要使用x64 Tomcat可执行文件,请参阅更多信息。

Did I miss something? 我错过了什么?

Edit 2 编辑2

Ah, okay, buried in some paragraphs above that link is this: 啊,好吧,埋在上面这段链接的一些段落是这样的:

"if you run as Windows service and want to upgrade JRE to 64 bit version, you will need to replace \\jre with appropriate JRE" “如果您作为Windows服务运行并希望将JRE升级到64位版本,则需要使用适当的JRE替换\\ jre”

So I guess I need to copy some files into the /jre folder? 所以我想我需要将一些文件复制到/ jre文件夹中?

The way I made it work (TeamCity 8, Windows server 2008 r2): 我的工作方式(TeamCity 8,Windows server 2008 r2):

  • Install the 64-bit JRE on the target machine, now there are two ways to do this 在目标计算机上安装64位JRE,现在有两种方法可以执行此操作

  • A -> If you are using the Teamcity bundled JRE, replace the JRE folder ([TC Server folder]\\JRE) with the JRE folder in the newly installed JRE x64 - You have to shut down the TC server service (along with all java.exe*32 services that might also use this JRE) A - >如果您使用Teamcity捆绑的JRE,请将JRE文件夹([TC Server文件夹] \\ JRE)替换为新安装的JRE x64中的JRE文件夹 - 您必须关闭TC服务器服务(以及所有Java) .exe * 32也可能使用此JRE的服务)

  • B -> Change the TeamCity Internal properties, to point to newly installed JRE x64 ( see documentation for TC version 8 , TC version 9 can be found here ): B - >更改TeamCity内部属性,指向新安装的JRE x64( 请参阅TC版本8的文档, 可在此处找到TC版本9 ):

     java.home=C\\:\\\\<JRE x64 install folder>\\\\jre java.ext.dirs=C\\:\\\\<JRE x64 install folder>\\\\jre\\\\lib\\\\ext\\;C\\:\\\\Windows\\\\Sun\\\\Java\\\\lib\\\\ext java.library.path=C\\:\\\\<JRE x64 install folder>\\\\jre\\\\bin\\;C\\:\\\\Windows\\\\Sun\\\\Java\\\\bin\\;C\\:\\\\Windows\\\\system32\\;C\\:\\\\Windows\\;C\\:\\\\local\\\\Oracle\\\\clients\\\\112_64\\\\bin\\;C\\:\\\\local\\\\Oracle… 
  • An alternative to point B would be to change Environment variable JAVA_HOME, it`s more simple, but it requires a Windows server restart after that B点的替代方案是更改环境变量JAVA_HOME,它更简单,但它需要在此之后重新启动Windows服务器

  • If you run the TC Server service now, it should run as a 64-bit Java process (chceck via PID in task manager) : 如果您现在运行TC Server服务,它应该作为64位Java进程运行(通过任务管理器中的PID chceck):

资源监控任务管理器

The snippet from the updated question had a link in the original, pointing to the instructions on Java update for TeamCity server in TeamCity online doc. 更新后的问题的片段在原始链接中有一个链接,指向TeamCity在线文档中TeamCity服务器的Java更新说明

Basically, the instructions vary based on the TeamCity distribution used and way of launching the server. 基本上,指令因使用的TeamCity分发和启动服务器的方式而异。

If your intent is to increase the memory for the TeamCity server, please make sure to read through the corresponding section on the same doc page. 如果您的目的是增加TeamCity服务器的内存,请务必仔细阅读同一文档页面上的相应部分

Yet one more note: recent TeamCity versions perform Git fetch in a separate process and Git-related memory issues during fetch might require fine-tuning of the corresponding options . 还有一点需要注意:最近的TeamCity版本在一个单独的进程中执行Git fetch,并且在获取期间与Git相关的内存问题可能需要微调相应的选项

"So I guess I need to copy some files into the /jre folder?" “所以我想我需要将一些文件复制到/ jre文件夹中?”

No. You install a 64 bit JRE, and update the relevant setting to point at the 64-bit install's JRE. 不。您安装 64位JRE,并更新相关设置以指向64位安装的JRE。

Don't copy stuff from one JRE installation into another. 不要将东西从一个JRE安装复制到另一个。 You will break things! 你会破坏的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM