이클립스에서 여러개의 프로젝트를 동시에 올리고, 개발을 해야 할일이 꽤 많다.

여러개의 서비스를 띄우다가 보면, 다음과 같이 메모리 에러가 종종 발생을 한다.

메모리를 많이 사용하는 프로젝트는 서비스 하나만 띄우도 발생을 한다.

2008-04-08 08:45:19 [ERROR](StandardWrapperValve.java:253) Servlet.service() for servlet action threw exception
java.lang.OutOfMemoryError: Java heap space



servers tab에서 해당 server를 더블클릭을 한다.
User inserted image


다음과 같은 화면이 나온다.
User inserted image

open launch configuration을 클릭을 하고, argument tab에서 다음과 같은 옵션을 추가해야 한다.

MaxPermSize는 spring이나 여러가지 framework에서 내부적으로 reflection을 많이 사용하기때문에 반드시 메모리를 늘려줘야 한다.  

tomcat memory option
-XX:MaxPermSize=128m -Xms128m -Xmx512m


User inserted image


Posted by ologist

This error manifests that a page is far too large, larger then 2 MB.
Apache Tomcat 5, by default, sets the maximum size of acceptable HTTP POST request to 2MB.

You can reconfigure Tomcat to accept larger requests. This can be done by increasing the allowable limit or just simply disabling this functionality.
The file you need to edit is <Tomcat-Dir>/server.xml. Set the Tomcat configuration parameter maxPostSize for the HTTPConnector to a larger value (in bytes)
to increase the limit. Setting it to 0 will disable the size check.

java.lang.IllegalStateException: Post too large
at org.apache.catalina.connector.Request.parseParameters(Request.java:2361)


http://confluence.atlassian.com/display/DOC/Max+size+of+HTTP+POST+request+and+Confluence+page+size


아래는 $TOMCAT_HOME/conf/server.xml에 설정을 해야 하는 옵션이다.
maxPostSize에 필요한 용량제한을 셋팅하면 된다.

<Connector port="8102" minProcessors="1" maxProcessors="5"
            enableLookups="false" redirectPort="8443" acceptCount="100"
            debug="0" connectionTimeout="120000" useBodyEncodingForURI="true"
            maxPostSize="3145728"
            protocol="AJP/1.3" />

Posted by ologist
한글을 사용하고 멀티바이트를 쓰는 우리는 항상 개발시 한글문제 or 다국어 문제에 직면을 하게 된다. 톰캣을 사용하다가 보면 일관적인 정책이 아니라 자꾸 설정하는 위치가 바뀌어서 애를 먹는데, tomcat5.5.12에서의 인코딩설정 방법을 정리해보자.

1. SetCharacterEncodingFilter : 필터에 원하는 인코딩으로 셋팅을 한다. 이 부분은 body를 인코딩한다.

2. 단독 tomcat일 경우는  이곳의 attribute를 추가하고 셋팅을 한다.
  <Connector acceptCount="100"
   connectionTimeout="20000" disableUploadTimeout="true"
   enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75"
   maxThreads="150" minSpareThreads="25" port="8080" redirectPort="8443"
  URIEncoding="MS949" />

3.apache와 컨넥터로 연결할 경우 이곳의 attribute를 추가하고 셋팅을 한다.
<Connector enableLookups="false" port="8022" protocol="AJP/1.3" redirectPort="8443"
   URIEncoding="MS949" />

tomcat3.x부터 지금가지 사용을 해왔는데, 정말 한글문제나 다국어 문제 징그럽다. 그냥 모두 UTF-8으로 가는거 안되겠니?
Posted by ologist
 TAG Encoding, tomcat
이전버튼 1 이전버튼

블로그 이미지
ologist

공지사항

Yesterday191
Today137
Total34,709

달력

 « |  » 2012.02
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      

최근에 받은 트랙백

글 보관함