JavaのSimpleDateFormatについて質問があります。
現在staticメソッド内で
SimpleDateFormatを毎回newして使用しています。
このメソッドはSimpleDateFormatを利用して
日付形式の変換を行うものです。
下記はソースの一部です。
private static String convertDateStyle(String tgt, String oldstyle, String newstyle) throws ParseException { SimpleDateFormat sdfOrg = new SimpleDateFormat(oldstyle); SimpleDateFormat sdfCon = new SimpleDateFormat(newstyle); Date d = sdfOrg.parse(tgt); : : }
ところでこの毎回newしてSimpleDateFormatを使用すると、
ガベージコレクション(gc)が回収してくれないとの記事を見つけました。
http://blog.loadlimits.info/2011/11/simpledateformat%E3%81%8C%E3%83%A1%E3%83%A2%E3%83%AA%E3%82%92%E9%A3%9F%E3%81%84%E5%B0%BD%E3%81%8F%E3%81%99%E4%BB%B6/
私が使用しているjreは「jre-10.0.2」なのですが、
やはり同様の現象が起きるものなのでしょうか?

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/09 15:24