CATALINA_OPTS
값 : -XX:MaxPermSize=128m;-Xms256m;-Xmx1024m

http://www.javaservice.net/~java/bbs/read.cgi?m=appserver&b=engine&c=r_p&n=1086178689

◈ 톰캣 힙 메모리 조정하기 (윈도우용)
1. ( 톰캣 실행 파일 catalina.bat 수정 ) catalina.bat 파일 내에 해당 내용을 입력한다.
set JAVA_OPTS=-server -Xms128m -Xmx128m

시작 > 실행 > cmd (도스창들어간후) > catalina.bat stop 실행
시작 > 실행 > cmd (도스창들어간후) > catalina.bat start 실행
2. 서비스 시작 / 종료 파일생성
tomcat_start.bat ( 서비스 시작 )
C:
cd C:\Program Files\Apache Group\Tomcat 4.1\bin\
catalina.bat start
tomcat_stop.bat ( 서비스 종료 )
C:
cd C:\Program Files\Apache Group\Tomcat 4.1\bin\
catalina.bat stop
◈ 톰캣 힙메모리 조정하기 (리눅스용)

vi ./startup.sh   ( 톰캣 실행 파일 startup.sh 수정 )

#!/bin/sh
# -----------------------------------------------------------------------------
# Start Script for the CATALINA Server
#
# $Id: startup.sh,v 1.2 2002/01/15 02:55:38 patrickl Exp $
# -----------------------------------------------------------------------------

# resolve links - $0 may be a softlink
PRG="$0"

while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done

PRGDIR=`dirname "$PRG"`
##############512m로 강제 셋팅 : START
export CATALINA_OPTS="-Djava.awt.headless=true -Xms512m -Xmx512m"
##############512m로 강제 셋팅 : END
EXECUTABLE=catalina.sh

########  ms, mx 값은 CPU의 갯수와 MEM크기에 따라 적절히 조정합니다. (EX:-Xms512m -Xmx512m )

# Check that target executable exists
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
  echo "Cannot find $PRGDIR/$EXECUTABLE"
  echo "This file is needed to run this program"
  exit 1
fi

exec "$PRGDIR"/"$EXECUTABLE" start "$@"

출처 : http://prettyboa.cafe24.com

'was' 카테고리의 다른 글

메모리 관련  (0) 2010.02.19
Apache Mod_Security  (0) 2010.02.17
charset 과 pageEncoding의 차이  (0) 2009.12.23
server.xml 설정 관련  (0) 2009.12.08
톰캣 plugin url  (0) 2009.12.08
Posted by gt1000
http://nogun.tistory.com/64

우연히 eclipse 에서 프로젝트를 수행하는데, 어디선가 에러가 나서 확인해보았다.

Access restriction: The constructor BASE64Decoder() is not accessible due to restriction on required library C:\Java\jdk1.5.0_17\jre\lib\rt.

음.. 왜 그럴까 검색을 해보았더니, 문서가 나와있었다.


sun.* package에 있는 라이브러리는 pure 자바로 개발된 코드가 아니어서 플랫폼 독립적이지 않다고 하네.
마지막 문구에는 대놓고 쓰지말라는 

In general, writing java programs that rely on sun.* is risky: they are not portable, and are not supported.

그래서 어떻게 Base64 Encoding/Decoding 을 처리하느냐... 


친절하게 apache commons에서 제공하는 codec 라이브러리를 이용하라고 답을 주시네..허허허..

내가 개발한게 아니어서..이클립스에서 해당 관련 사항은 Warning으로 처리하도록 변경~~~
이놈의 이기주의..ㅡㅡ;




귀찮아서 간단히 한 코덱 소스
package com.futurenuri.common.util;

import java.security.InvalidKeyException;
import java.security.Key;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;

import org.apache.commons.codec.binary.Base64;

public class LocalEncrypter {

//    private static Log log = LogFactory.getLog(LocalEncrypter.class);
   
    private String algorithm = "DESede";
    private Key key;
    private Cipher cipher;
 
    public LocalEncrypter() throws Exception {
        key = KeyGenerator.getInstance( algorithm ).generateKey();
        cipher = Cipher.getInstance( algorithm );
    }
   
    /**
     * 엔코드 한 스트링을 돌려줌
     * @param input
     * @return
     * @throws InvalidKeyException
     * @throws BadPaddingException
     * @throws IllegalBlockSizeException
     */
    public String getEncrypt(String input) throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
        cipher.init( Cipher.ENCRYPT_MODE, key );
        byte [] inputBytes = input.getBytes();
        byte [] encryptionBytes = cipher.doFinal( inputBytes );
        return Base64.encodeBase64String(encryptionBytes);
    }
   
    /**
     * 디코드한 스트링을 돌려줌
     * @param encodeString
     * @return
     * @throws InvalidKeyException
     * @throws BadPaddingException
     * @throws IllegalBlockSizeException
     */
    public String getDecrypt(String encodeString) throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
        byte [] encryptionBytes = Base64.decodeBase64(encodeString);
        cipher.init( Cipher.DECRYPT_MODE, key );
        byte [] recoveredBytes = cipher.doFinal( encryptionBytes );
        return new String( recoveredBytes );
    }
}

'java' 카테고리의 다른 글

자바 관련 좋은 사이트 및 서적  (0) 2010.04.15
ssh 관련 메모  (0) 2010.02.17
톰캣, 자바 메모리 관련  (0) 2010.02.03
파일 다운 로드 관련  (0) 2010.02.03
URL 컨텐츠 얻어 오는 소스 테스트  (0) 2009.12.22
Posted by gt1000
톰캣 JConsole
http://cacky.tistory.com/39


java power tools 라는 책을 보셔도 나옵니다.
http://www.wakaleo.com/java-power-tools

'java' 카테고리의 다른 글

ssh 관련 메모  (0) 2010.02.17
암호화 관련 간단 테스트 코드  (0) 2010.02.08
파일 다운 로드 관련  (0) 2010.02.03
URL 컨텐츠 얻어 오는 소스 테스트  (0) 2009.12.22
파일 업로더  (0) 2009.12.10
Posted by gt1000

블로그 이미지
gt1000

태그목록

공지사항

어제
오늘

달력

 « |  » 2024.4
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 30

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함