LoginSignup
0
0

More than 3 years have passed since last update.

Azure App Service の Tomcat で Javaのヒープサイズを変更する

Last updated at Posted at 2019-11-12

前提

Azure WebApp のサーバータイプはWindows

操作

  1. Azure Webコンソール上で App Service を開く
  2. Development Toolsのうち「Advanced Tools」を開く(Kudu)
  3. Debug Consoleから「CMD」を開く(単なるコマンドラインではなくGUI的にも使える)
  4. デフォルトで「D:\home」が開いている状態なので「D:\home\site\wwwroot」を開く(マウス操作でも可能)
  5. [wwwroot]の右側にある「+」をクリックして「New File」を選択する
  6. 「web.config」というファイルを作成して以下のようにする。「%AZURE_TOMCAT90%」はTOMCATのバージョンによって異なるので確認する。(SETコマンドで環境変数一覧が表示されるのでそこで確認できる)
  7. アプリを再起動する
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers>
        <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="%AZURE_TOMCAT90_HOME%\bin\startup.bat" arguments="">
      <environmentVariables>
        <environmentVariable name="JAVA_OPTS" value="-Xmx1500m -Xms1024m -Djava.net.preferIPv4Stack=true" />
      </environmentVariables>
    </httpPlatform>
  </system.webServer>
</configuration>

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0