Slow native memory leak in UAA
We are load testing the UAA for any resource leaks and we came across a very slow native memory leak which eventually crashes the app. We are testing 2 REST endpoints in a continuous loop using Jmeter with 50 threads: POST /oauth/token POST /check_token When running the above scenario for about 4+ hours and printing the output of "cf app <app_name> | grep running" every minute, we see the following:
#0 running 2015-08-04 11:42:41 AM 65.7% 946.2M of 1G 195.6M of 1G
#0 running 2015-08-04 11:42:41 AM 72.7% 940.3M of 1G 188.1M of 1G
#0 running 2015-08-04 11:42:41 AM 65.2% 944.7M of 1G 190.3M of 1G
#0 running 2015-08-04 11:42:41 AM 75.6% 946.9M of 1G 192.6M of 1G
#0 running 2015-08-04 11:42:41 AM 68.9% 949.3M of 1G 195.3M of 1G
#0 running 2015-08-04 11:42:41 AM 73.3% 951.5M of 1G 197.6M of 1G
#0 running 2015-08-04 11:42:41 AM 80.5% 944.6M of 1G 190M of 1G
#0 running 2015-08-04 11:42:41 AM 80.3% 948.7M of 1G 192.3M of 1G
#0 running 2015-08-04 11:42:41 AM 68.3% 944.7M of 1G 194.5M of 1G
#0 running 2015-08-04 11:42:41 AM 77.2% 946.8M of 1G 197.3M of 1G
#0 running 2015-08-04 11:42:41 AM 74.1% 940.6M of 1G 189.5M of 1G
#0 running 2015-08-04 11:42:41 AM 67.8% 943.5M of 1G 191.8M of 1G
#0 running 2015-08-04 11:42:41 AM 72.5% 946.2M of 1G 194.2M of 1G
#0 running 2015-08-04 11:42:41 AM 72.0% 948.9M of 1G 196.4M of 1G
#0 running 2015-08-04 11:42:41 AM 74.0% 942.9M of 1G 189M of 1G
#0 running 2015-08-04 11:42:41 AM 76.5% 947M of 1G 191.3M of 1G
#0 running 2015-08-04 11:42:41 AM 70.8% 949M of 1G 193.5M of 1G
#0 running 2015-08-04 11:42:41 AM 63.5% 950.5M of 1G 195.8M of 1G
#0 running 2015-08-04 11:42:41 AM 74.5% 942.6M of 1G 188.1M of 1G
#0 running 2015-08-04 11:42:41 AM 66.0% 945.2M of 1G 190.3M of 1G
#0 running 2015-08-04 11:42:41 AM 78.1% 948.5M of 1G 192.9M of 1G
#0 running 2015-08-04 11:42:41 AM 77.2% 951.5M of 1G 195.3M of 1G
#0 running 2015-08-04 11:42:41 AM 80.1% 952.6M of 1G 197.5M of 1G
#0 running 2015-08-04 11:42:41 AM 78.1% 946M of 1G 189.7M of 1G
#0 running 2015-08-04 11:42:41 AM 66.6% 948.8M of 1G 192M of 1G
#0 running 2015-08-04 11:42:41 AM 70.7% 952.5M of 1G 194.6M of 1G
#0 running 2015-08-04 11:42:41 AM 84.8% 954M of 1G 196.9M of 1G
#0 running 2015-08-04 11:42:41 AM 75.0% 948.5M of 1G 189.2M of 1G
#0 running 2015-08-04 11:42:41 AM 78.5% 950.7M of 1G 191.5M of 1G
#0 running 2015-08-04 11:42:41 AM 73.6% 952.9M of 1G 193.8M of 1G
#0 running 2015-08-04 11:42:41 AM 73.3% 955M of 1G 196.1M of 1G
#0 running 2015-08-04 11:42:41 AM 64.4% 947.6M of 1G 188.6M of 1G
#0 running 2015-08-04 11:42:41 AM 76.9% 952.1M of 1G 191M of 1G
#0 running 2015-08-04 11:42:41 AM 71.2% 954.4M of 1G 193.2M of 1G
#0 running 2015-08-04 11:42:41 AM 66.7% 956.1M of 1G 195.4M of 1G
#0 running 2015-08-04 11:42:41 AM 75.7% 957.1M of 1G 197.8M of 1G
#0 running 2015-08-04 11:42:41 AM 77.3% 958.4M of 1G 196.2M of 1G
#0 running 2015-08-04 11:42:41 AM 85.5% 950.1M of 1G 188.4M of 1G
#0 running 2015-08-04 11:42:41 AM 77.8% 954.4M of 1G 190.8M of 1G
#0 running 2015-08-04 11:42:41 AM 66.7% 956.4M of 1G 193M of 1G
#0 running 2015-08-04 11:42:41 AM 77.5% 957M of 1G 195.7M of 1G
#0 running 2015-08-04 11:42:41 AM 78.6% 947.9M of 1G 188.1M of 1G
#0 running 2015-08-04 11:42:41 AM 72.4% 950.3M of 1G 190.3M of 1G
#0 running 2015-08-04 11:42:41 AM 77.2% 953.3M of 1G 192.7M of 1G
#0 running 2015-08-04 11:42:41 AM 62.9% 955.3M of 1G 195M of 1G
#0 running 2015-08-04 11:42:41 AM 60.9% 954.6M of 1G 197.7M of 1G
#0 running 2015-08-04 11:42:41 AM 74.4% 949.5M of 1G 189.9M of 1G
#0 running 2015-08-04 11:42:41 AM 68.7% 952.1M of 1G 192.3M of 1G
#0 running 2015-08-04 11:42:41 AM 85.8% 954.9M of 1G 194.7M of 1G
#0 running 2015-08-04 11:42:41 AM 82.7% 954.6M of 1G 197M of 1G
#0 running 2015-08-04 11:42:41 AM 84.7% 948.4M of 1G 189.6M of 1G
#0 running 2015-08-04 11:42:41 AM 85.5% 951.4M of 1G 192M of 1G
#0 running 2015-08-04 11:42:41 AM 63.7% 953.7M of 1G 194.2M of 1G
#0 running 2015-08-04 11:42:41 AM 75.9% 954.3M of 1G 196.4M of 1G
#0 running 2015-08-04 11:42:41 AM 67.5% 947.7M of 1G 188.7M of 1G
#0 running 2015-08-04 11:42:41 AM 83.7% 950.5M of 1G 191.4M of 1G
#0 running 2015-08-04 11:42:41 AM 69.7% 953.2M of 1G 193.7M of 1G
#0 running 2015-08-04 11:42:41 AM 77.5% 954M of 1G 196.1M of 1G
#0 running 2015-08-04 11:42:41 AM 84.6% 946.6M of 1G 188.4M of 1G
#0 running 2015-08-04 11:42:41 AM 65.1% 949.7M of 1G 191M of 1G
#0 running 2015-08-04 11:42:41 AM 73.0% 952.4M of 1G 193.3M of 1G
#0 running 2015-08-04 11:42:41 AM 73.0% 953.8M of 1G 195.6M of 1G
#0 running 2015-08-04 11:42:41 AM 80.4% 945.6M of 1G 187.9M of 1G
#0 running 2015-08-04 11:42:41 AM 77.2% 949.1M of 1G 190.7M of 1G
#0 running 2015-08-04 11:42:41 AM 60.9% 951.7M of 1G 192.9M of 1G
#0 running 2015-08-04 11:42:41 AM 73.9% 953.4M of 1G 195.1M of 1G
#0 running 2015-08-04 11:42:41 AM 69.4% 953.6M of 1G 197.4M of 1G
#0 running 2015-08-04 11:42:41 AM 66.5% 949.4M of 1G 190M of 1G
#0 running 2015-08-04 11:42:41 AM 67.7% 951.6M of 1G 192.3M of 1G
#0 running 2015-08-04 11:42:41 AM 57.4% 953.6M of 1G 194.5M of 1G
#0 running 2015-08-04 11:42:41 AM 68.8% 954.7M of 1G 196.7M of 1G
#0 running 2015-08-04 11:42:41 AM 74.0% 948.4M of 1G 189M of 1G
#0 running 2015-08-04 11:42:41 AM 68.5% 950.9M of 1G 191.3M of 1G
#0 running 2015-08-04 11:42:41 AM 70.7% 955.2M of 1G 194M of 1G
#0 running 2015-08-04 11:42:41 AM 74.0% 956.5M of 1G 196.3M of 1G
#0 running 2015-08-04 11:42:41 AM 73.3% 949.5M of 1G 188.6M of 1G
#0 running 2015-08-04 11:42:41 AM 77.8% 952.3M of 1G 190.9M of 1G
#0 running 2015-08-04 11:42:41 AM 78.6% 955.1M of 1G 193.3M of 1G
#0 running 2015-08-04 11:42:41 AM 71.8% 958.1M of 1G 196M of 1G
#0 running 2015-08-04 11:42:41 AM 87.1% 951.1M of 1G 188.3M of 1G
#0 running 2015-08-04 11:42:41 AM 81.5% 953.7M of 1G 190.6M of 1G
#0 running 2015-08-04 11:42:41 AM 67.9% 956.7M of 1G 192.9M of 1G
#0 running 2015-08-04 11:42:41 AM 70.3% 958.7M of 1G 195.1M of 1G
#0 running 2015-08-04 11:42:41 AM 86.1% 960.1M of 1G 197.8M of 1G
#0 running 2015-08-04 11:42:41 AM 83.4% 954.9M of 1G 190.1M of 1G
#0 running 2015-08-04 11:42:41 AM 66.2% 957.6M of 1G 192.4M of 1G
#0 running 2015-08-04 11:42:41 AM 76.5% 960.3M of 1G 194.7M of 1G
#0 running 2015-08-04 11:42:41 AM 81.7% 961.7M of 1G 197M of 1G
#0 running 2015-08-04 11:42:41 AM 78.5% 956.2M of 1G 189.8M of 1G
#0 running 2015-08-04 11:42:41 AM 65.9% 959.1M of 1G 192M of 1G
#0 running 2015-08-04 11:42:41 AM 70.7% 961.2M of 1G 194.3M of 1G
#0 running 2015-08-04 11:42:41 AM 73.7% 963M of 1G 196.6M of 1G
#0 running 2015-08-04 11:42:41 AM 63.1% 956.8M of 1G 188.9M of 1G
#0 running 2015-08-04 11:42:41 AM 62.6% 960M of 1G 191.6M of 1G
#0 running 2015-08-04 11:42:41 AM 81.1% 962.9M of 1G 193.8M of 1G
#0 running 2015-08-04 11:42:41 AM 69.3% 964.7M of 1G 196.1M of 1G
#0 running 2015-08-04 11:42:41 AM 61.3% 957.9M of 1G 188.4M of 1G
#0 running 2015-08-04 11:42:41 AM 68.8% 962.4M of 1G 190.6M of 1G
#0 running 2015-08-04 11:42:41 AM 69.9% 964.8M of 1G 193.3M of 1G
#0 running 2015-08-04 11:42:41 AM 77.5% 966.1M of 1G 195.6M of 1G
#0 running 2015-08-04 11:42:41 AM 72.2% 958.9M of 1G 187.9M of 1G
#0 running 2015-08-04 11:42:41 AM 74.6% 961.9M of 1G 190.2M of 1G
#0 running 2015-08-04 11:42:41 AM 68.2% 964.7M of 1G 192.5M of 1G
#0 running 2015-08-04 11:42:41 AM 75.5% 967M of 1G 194.8M of 1G
#0 running 2015-08-04 11:42:41 AM 74.4% 968.4M of 1G 197.5M of 1G
#0 running 2015-08-04 11:42:41 AM 76.2% 964.8M of 1G 190M of 1G
#0 running 2015-08-04 11:42:41 AM 66.5% 966.8M of 1G 192.2M of 1G
#0 running 2015-08-04 11:42:41 AM 78.0% 968.8M of 1G 194.6M of 1G
#0 running 2015-08-04 11:42:41 AM 78.6% 970.2M of 1G 197.3M of 1G
#0 running 2015-08-04 11:42:41 AM 71.8% 964.3M of 1G 189.6M of 1G
#0 running 2015-08-04 11:42:41 AM 82.7% 968.5M of 1G 191.9M of 1G
#0 running 2015-08-04 11:42:41 AM 72.1% 970.5M of 1G 194.1M of 1G
#0 running 2015-08-04 11:42:41 AM 73.1% 971.9M of 1G 196.4M of 1G
#0 running 2015-08-04 11:42:41 AM 72.5% 965.2M of 1G 188.7M of 1G
#0 running 2015-08-04 11:42:41 AM 74.7% 968.5M of 1G 191.4M of 1G
#0 running 2015-08-04 11:42:41 AM 71.0% 970.9M of 1G 193.7M of 1G
#0 running 2015-08-04 11:42:41 AM 77.8% 973.3M of 1G 196.1M of 1G
#0 running 2015-08-04 11:42:41 AM 68.8% 966.4M of 1G 188.3M of 1G
#0 running 2015-08-04 11:42:41 AM 74.5% 969.3M of 1G 190.5M of 1G
#0 running 2015-08-04 11:42:41 AM 70.1% 972.6M of 1G 193.1M of 1G
#0 running 2015-08-04 11:42:41 AM 70.9% 976.1M of 1G 195.5M of 1G
#0 running 2015-08-04 11:42:41 AM 84.0% 976.2M of 1G 197.7M of 1G
#0 running 2015-08-04 11:42:41 AM 64.2% 970.4M of 1G 190M of 1G
#0 running 2015-08-04 11:42:41 AM 89.9% 973.2M of 1G 192.4M of 1G
#0 running 2015-08-04 11:42:41 AM 80.3% 976.1M of 1G 194.6M of 1G
#0 running 2015-08-04 11:42:41 AM 69.9% 977.2M of 1G 197M of 1G
#0 running 2015-08-04 11:42:41 AM 60.5% 971.8M of 1G 189.8M of 1G
#0 running 2015-08-04 11:42:41 AM 81.7% 974.1M of 1G 192.1M of 1G
#0 running 2015-08-04 11:42:41 AM 79.8% 977.3M of 1G 194.4M of 1G
#0 running 2015-08-04 11:42:41 AM 68.4% 979M of 1G 196.6M of 1G
#0 running 2015-08-04 11:42:41 AM 75.6% 972.5M of 1G 188.9M of 1G
#0 running 2015-08-04 11:42:41 AM 80.8% 975.3M of 1G 191.6M of 1G
#0 running 2015-08-04 11:42:41 AM 72.5% 978.3M of 1G 193.8M of 1G
#0 running 2015-08-04 11:42:41 AM 76.6% 980.5M of 1G 196.2M of 1G
#0 running 2015-08-04 11:42:41 AM 71.0% 974M of 1G 188.6M of 1G
#0 running 2015-08-04 11:42:41 AM 71.0% 977.6M of 1G 190.8M of 1G
#0 running 2015-08-04 11:42:41 AM 64.0% 980M of 1G 193.5M of 1G
#0 running 2015-08-04 11:42:41 AM 73.8% 981.6M of 1G 195.7M of 1G
#0 running 2015-08-04 11:42:41 AM 72.6% 974.8M of 1G 187.9M of 1G
#0 running 2015-08-04 11:42:41 AM 72.3% 978M of 1G 190.1M of 1G
#0 running 2015-08-04 11:42:41 AM 67.5% 981.6M of 1G 192.3M of 1G
#0 running 2015-08-04 11:42:41 AM 80.1% 982.9M of 1G 194.6M of 1G
#0 running 2015-08-04 11:42:41 AM 66.8% 984M of 1G 197.2M of 1G
#0 running 2015-08-04 11:42:41 AM 72.8% 978.2M of 1G 189.4M of 1G
#0 running 2015-08-04 11:42:41 AM 74.2% 980.7M of 1G 191.7M of 1G
#0 running 2015-08-04 11:42:41 AM 67.7% 983.3M of 1G 193.9M of 1G
#0 running 2015-08-04 11:42:41 AM 68.9% 985.5M of 1G 196.6M of 1G
#0 running 2015-08-04 11:42:41 AM 71.9% 980.6M of 1G 188.9M of 1G
#0 running 2015-08-04 11:42:41 AM 75.3% 982.7M of 1G 191.2M of 1G
#0 running 2015-08-04 11:42:41 AM 79.0% 984.3M of 1G 193.4M of 1G
#0 running 2015-08-04 11:42:41 AM 74.7% 986.9M of 1G 196M of 1G
#0 running 2015-08-04 11:42:41 AM 68.9% 980.5M of 1G 188.3M of 1G
#0 running 2015-08-04 11:42:41 AM 62.9% 984.5M of 1G 190.5M of 1G
#0 running 2015-08-04 11:42:41 AM 68.1% 986.7M of 1G 192.7M of 1G
#0 running 2015-08-04 11:42:41 AM 80.6% 988.7M of 1G 194.9M of 1G
#0 running 2015-08-04 11:42:41 AM 68.5% 990.1M of 1G 197.2M of 1G
#0 running 2015-08-04 11:42:41 AM 68.6% 993.8M of 1G 189.7M of 1G
#0 running 2015-08-04 11:42:41 AM 74.4% 998.7M of 1G 192.4M of 1G
#0 running 2015-08-04 11:42:41 AM 79.8% 1001M of 1G 194.7M of 1G
#0 running 2015-08-04 11:42:41 AM 73.9% 1002.4M of 1G 197M of 1G
#0 running 2015-08-04 11:42:41 AM 68.3% 999.4M of 1G 189.2M of 1G
#0 running 2015-08-04 11:42:41 AM 70.4% 1004.3M of 1G 191.5M of 1G
#0 running 2015-08-04 11:42:41 AM 75.4% 1006.2M of 1G 193.8M of 1G
#0 running 2015-08-04 11:42:41 AM 79.4% 1005.9M of 1G 196.5M of 1G
#0 running 2015-08-04 11:42:41 AM 74.4% 1005.6M of 1G 188.9M of 1G
#0 running 2015-08-04 11:42:41 AM 69.1% 1007.7M of 1G 191.1M of 1G
#0 running 2015-08-04 11:42:41 AM 73.5% 1010.1M of 1G 193.6M of 1G
#0 running 2015-08-04 11:42:41 AM 60.6% 1011.2M of 1G 195.8M of 1G
#0 running 2015-08-04 11:42:41 AM 70.3% 1004.7M of 1G 188.1M of 1G
#0 running 2015-08-04 11:42:41 AM 74.6% 1010M of 1G 190.7M of 1G
#0 running 2015-08-04 11:42:41 AM 76.2% 1012.1M of 1G 193M of 1G
#0 running 2015-08-04 11:42:41 AM 81.5% 1012.9M of 1G 195.2M of 1G
#0 running 2015-08-04 11:42:41 AM 75.2% 1011.6M of 1G 197.5M of 1G
#0 running 2015-08-04 11:42:41 AM 67.6% 1010.6M of 1G 189.8M of 1G
#0 running 2015-08-04 11:42:41 AM 76.4% 1015.1M of 1G 192.1M of 1G
#0 running 2015-08-04 11:42:41 AM 77.2% 1017.3M of 1G 194.9M of 1G
#0 running 2015-08-04 11:42:41 AM 74.2% 1015.3M of 1G 197.2M of 1G
#0 running 2015-08-04 11:42:41 AM 72.7% 1015M of 1G 189.3M of 1G
#0 running 2015-08-04 11:42:41 AM 73.5% 1017.7M of 1G 191.7M of 1G
#0 running 2015-08-04 11:42:41 AM 55.7% 1018.3M of 1G 194M of 1G
#0 running 2015-08-04 11:42:41 AM 72.0% 1018M of 1G 196.7M of 1G
#0 running 2015-08-04 11:42:41 AM 76.6% 1017.1M of 1G 189M of 1G
#0 running 2015-08-04 11:42:41 AM 80.0% 1020.4M of 1G 191.5M of 1G
#0 running 2015-08-04 11:42:41 AM 81.4% 1023M of 1G 193.7M of 1G
#0 running 2015-08-04 11:42:41 AM 76.4% 1020.2M of 1G 196M of 1G
#0 running 2015-08-04 11:42:41 AM 61.2% 1020.2M of 1G 188.3M of 1G
#0 running 2015-08-04 11:42:41 AM 70.6% 1022.5M of 1G 190.9M of 1G
#0 running 2015-08-04 11:42:41 AM 78.5% 1021.6M of 1G 193.1M of 1G
#0 running 2015-08-04 11:42:41 AM 80.2% 1020.9M of 1G 195.5M of 1G
#0 running 2015-08-04 11:42:41 AM 76.0% 1021.1M of 1G 187.9M of 1G
#0 running 2015-08-04 11:42:41 AM 78.7% 1021.4M of 1G 190.7M of 1G
#0 running 2015-08-04 11:42:41 AM 72.9% 1022.9M of 1G 193M of 1G
#0 running 2015-08-04 11:42:41 AM 80.5% 1021.9M of 1G 195.4M of 1G
#0 running 2015-08-04 11:42:41 AM 76.1% 1022.8M of 1G 197.8M of 1G
#0 running 2015-08-04 11:42:41 AM 86.5% 1022.8M of 1G 190.2M of 1G
#0 running 2015-08-04 11:42:41 AM 67.4% 1022.2M of 1G 192.4M of 1G
#0 running 2015-08-04 11:42:41 AM 73.1% 1023.3M of 1G 195M of 1G
#0 running 2015-08-04 11:42:41 AM 81.7% 1022.4M of 1G 197.4M of 1G
#0 running 2015-08-04 11:42:41 AM 69.6% 1023.3M of 1G 189.6M of 1G
#0 running 2015-08-04 11:42:41 AM 73.9% 1023M of 1G 192.2M of 1G
#0 running 2015-08-04 11:42:41 AM 76.4% 1023M of 1G 194.4M of 1G
#0 running 2015-08-04 11:42:41 AM 69.7% 1023.6M of 1G 196.7M of 1G
#0 running 2015-08-04 04:07:10 PM 0.0% 848.2M of 1G 177.9M of 1G
#0 running 2015-08-04 04:07:10 PM 95.7% 885.6M of 1G 180.2M of 1G
As you can see above, the memory slowly increases until it reaches the max memory of the container and it crashes and restarts. The last few lines of "cf logs <app_name>" is the following:
2015-08-04T16:06:29.20-0700 [RTR/0] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:17 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:52302 x_forwarded_for:"10.202.90.62" vcap_request_id:6b1f4627-e494-44e5-41c7-8546e3c51777 response_time:12.073339565 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:18 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:42934 x_forwarded_for:"10.202.90.62" vcap_request_id:52998970-e0fc-49a5-407a-924d044a0172 response_time:11.147456262 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/0] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:17 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:54880 x_forwarded_for:"10.202.90.62" vcap_request_id:669f2df5-02e1-4e2a-6054-8e63bc384b58 response_time:11.790186063 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/0] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:18 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:43591 x_forwarded_for:"10.202.90.62" vcap_request_id:7b55c289-454a-4555-5642-19ca1d01560a response_time:10.904381637 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/0] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:17 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:43536 x_forwarded_for:"10.202.90.62" vcap_request_id:55797793-5d72-4fb5-4e8b-888eb401c442 response_time:11.748515105 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [App/0] ERR
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:21 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:36097 x_forwarded_for:"10.202.90.62" vcap_request_id:d2bc35e4-e254-498a-7be8-a93d3b2e5d62 response_time:7.878047235 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:14 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:35798 x_forwarded_for:"10.202.90.62" vcap_request_id:1a8f8efc-8ce6-4d86-4f59-6e0c61dfd033 response_time:15.027416973 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:21 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36700 x_forwarded_for:"10.202.90.62" vcap_request_id:88659676-772a-4361-5921-4901bf5cf977 response_time:7.270077653 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:15 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36429 x_forwarded_for:"10.202.90.62" vcap_request_id:465ae1a5-d472-471b-50e5-25d0bb8a7b1c response_time:13.654021073 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:25 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36814 x_forwarded_for:"10.202.90.62" vcap_request_id:2792cef1-a304-4e92-473e-1fabd82e5646 response_time:3.818224662 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:15 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36444 x_forwarded_for:"10.202.90.62" vcap_request_id:c214946f-9c38-4ce1-5e64-fc4ca2c9c609 response_time:13.254990359 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:15 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:35839 x_forwarded_for:"10.202.90.62" vcap_request_id:c95bfd0f-ffa3-49b0-6651-d12e92deb7c2 response_time:13.315398049 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:15 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36433 x_forwarded_for:"10.202.90.62" vcap_request_id:dc643308-788b-41c1-42f8-927523d10d12 response_time:13.534326881 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:16 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36458 x_forwarded_for:"10.202.90.62" vcap_request_id:bbe7a2a7-7f60-448f-6710-7b3f8f9fcf17 response_time:12.961763668 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:17 +0000] "POST /oauth/token HTTP/1.1" 502 65 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36539 x_forwarded_for:"10.202.90.62" vcap_request_id:5e9596e9-c671-4b1e-4ddb-094eff2e2dd1 response_time:11.448713525 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:18 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:35979 x_forwarded_for:"10.202.90.62" vcap_request_id:997abe05-e0a5-458f-70dd-4c3187f03f29 response_time:11.001084686 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:18 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.154:35993 x_forwarded_for:"10.202.90.62" vcap_request_id:6c639aa8-004e-42cf-6b19-bd2910e38665 response_time:10.895185360 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:16 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36453 x_forwarded_for:"10.202.90.62" vcap_request_id:dad05f97-1e31-4ad8-745f-54962c9c9128 response_time:13.014725582 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:14 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36401 x_forwarded_for:"10.202.90.62" vcap_request_id:80cc0f6c-5587-4b54-7cd2-167912297887 response_time:14.289027513 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.20-0700 [RTR/1] OUT perf-uaa.grc-apps.svc.ice.ge.com - [04/08/2015:23:06:14 +0000] "POST /check_token HTTP/1.1" 502 1092 0 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 10.202.83.16:36375 x_forwarded_for:"10.202.90.62" vcap_request_id:4a28a2e2-21cc-469a-74b9-55fe2b4be845 response_time:14.949639511 app_id:a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:29.23-0700 [API/1] OUT App instance exited with guid a790109e-6a7e-460d-8a42-cdde9c993942 payload: {"cc_partition"=>"default", "droplet"=>"a790109e-6a7e-460d-8a42-cdde9c993942", "version"=>"a609220a-7e5d-4b85-9d00-d588bce7c8cb", "instance"=>"01d98e073c8441f8b51915227e572e47", "index"=>0, "reason"=>"CRASHED", "exit_status"=>255, "exit_description"=>"out of memory", "crash_timestamp"=>1438729589}
2015-08-04T16:06:43.56-0700 [DEA/11] OUT Starting app instance (index 0) with guid a790109e-6a7e-460d-8a42-cdde9c993942
2015-08-04T16:06:48.70-0700 [App/0] OUT Aug 4, 2015 23:06:48 +0000 [29 1] com.newrelic INFO: New Relic Agent: Loading configuration file "/home/vcap/app/.java-buildpack/new_relic_agent/./newrelic.yml"
2015-08-04T16:06:48.85-0700 [App/0] OUT Aug 4, 2015 23:06:48 +0000 [29 1] com.newrelic INFO: New Relic Agent: Writing to log file: /home/vcap/app/.java-buildpack/new_relic_agent/logs/newrelic_agent.log
2015-08-04T16:06:55.12-0700 [App/0] OUT [CONTAINER] org.apache.coyote.http11.Http11NioProtocol INFO Initializing ProtocolHandler ["http-nio-62932"]
2015-08-04T16:06:55.12-0700 [App/0] OUT [CONTAINER] org.apache.catalina.startup.Catalina INFO Initialization processed in 987 ms
2015-08-04T16:06:55.13-0700 [App/0] OUT [CONTAINER] org.apache.catalina.core.StandardService INFO Starting service Catalina
2015-08-04T16:06:55.13-0700 [App/0] OUT [CONTAINER] org.apache.catalina.core.StandardEngine INFO Starting Servlet Engine: Apache Tomcat/8.0.24
2015-08-04T16:06:55.17-0700 [App/0] OUT [CONTAINER] org.apache.catalina.startup.HostConfig INFO Deploying web application directory /home/vcap/app/.java-buildpack/tomcat/webapps/ROOT
I believe this is a native memory leak because when monitoring the application using New Relic during the test shows no stress on the heap and plenty of heap space available when it crashed. Below are some screenshots from New relic console during the test:
Heap memory:

Eden and Survivor space:

Tenured space:

Metaspace:

Garbage collection:

Threads:

As you can see above, the java heap seems just fine. Any pointers on what would be causing this memory leak?
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/100606238.
Thank you, do you mind sharing the Jmeter script, we'll run the exact same scenario here @sivabalans
Below is the jmeter script that we used:
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Secured Dashboard Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">50</stringProp>
<stringProp name="ThreadGroup.ramp_time">50</stringProp>
<longProp name="ThreadGroup.start_time">1423697540000</longProp>
<longProp name="ThreadGroup.end_time">1423697540000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Oauth_token_grant_type_password" enabled="true">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">username=marissa&password=koala&client_id=acs&grant_type=password</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">uaa.test.com</stringProp>
<stringProp name="HTTPSampler.port">443</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/oauth/token</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Authorization</stringProp>
<stringProp name="Header.value">Basic YWNzOmsadvFeaSACcasfdsgsddUByZGlhbg==</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Content-Type</stringProp>
<stringProp name="Header.value">application/x-www-form-urlencoded</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
<RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Regular Expression Extractor" enabled="true">
<stringProp name="RegexExtractor.useHeaders">false</stringProp>
<stringProp name="RegexExtractor.refname">access_token</stringProp>
<stringProp name="RegexExtractor.regex">{"access_token":"(.+?)"</stringProp>
<stringProp name="RegexExtractor.template">$1$</stringProp>
<stringProp name="RegexExtractor.default">***Access_token_not_fetched***</stringProp>
<stringProp name="RegexExtractor.match_number">1</stringProp>
</RegexExtractor>
<hashTree/>
<GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="Gaussian Random Timer" enabled="true">
<stringProp name="ConstantTimer.delay">0</stringProp>
<stringProp name="RandomTimer.range">5000</stringProp>
</GaussianRandomTimer>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="check_token" enabled="true">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">token=${access_token}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">uaa.test.com</stringProp>
<stringProp name="HTTPSampler.port">443</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/check_token</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="Gaussian Random Timer" enabled="true">
<stringProp name="ConstantTimer.delay">0</stringProp>
<stringProp name="RandomTimer.range">5000</stringProp>
</GaussianRandomTimer>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Authorization</stringProp>
<stringProp name="Header.value">Basic YWNzOmsadvFeaSACcasfdsgsddUByZGlhbg==</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
</hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="false">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<hostname>true</hostname>
<threadCounts>true</threadCounts>
<sampleCount>true</sampleCount>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan>
When I reviewed the last report in detail, I saw that the JVM did not even do 1 full GC before it crashed and started a new one. The memory of the app was set to 1GB and there was very little room(Hardly 120MB of headroom) for the JVM to warm up and get to a stage where it can collect the objects that are not referenced. So that probably manifested itself as a leak. So in the next test, I increased the app memory to 2GB and started a test on Aug 05. This time the app had about 1GB of headroom to grow. I let it run and this time the UAA is running fine for the past 5 days with no JVM crashes. And I also see full GCs happening at intervals which I believe is appropriate for the app to collect the de-referenced objects from the heap. There are no memory leaks, native or otherwise observed in this test.
Thank you @sivabalans !