---
title: "tomcat"
author: "hibeary"
date: "2014-02-13T14:47:44Z"
tags: []
categories: ["开源软件"]
slug: "tomcat"
draft: false
lastmod: "2014-02-28T14:29:22Z"
id: 2016996
url: "https://hibeary.iteye.com/blog/2016996"
---

Invalid initial heap size: -Xms512m-Xmx1024m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

启动tomcat，出现PermGen space 提示；启动tomcat，出现Could not create the Java virtual machine的 
这两个问题都是和环境变量配置有关系
JAVA_OPTS=-server -Xms512m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=128m 
修改MaxPermSize的值，比如变为256，只要比persize大就好

  ----server.xml
<Connector port="8983" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 

enableLookups="false" redirectPort="8443" acceptCount="100" 

connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" />