reduce memory that tomcat is using - java

I am using tomcat for my web application. I am starting server from services. I have this configuration:
-Xms256m;-Xmx512m;-XX:PermSize=256m;-XX:MaxPermSize=512M
When I change this configuration and restart service and check in task manager, how much memory it is using, it is showing that it is using the same memory every time.
Note: I am using tomcat 8 on 64 bit windows machine.

Related

restart of tomcat makes application faster

We have hosted our java application in Linux server. We developed an java application using Spring Boot framework where we have used postgresql 9.5.15 as database. Java,tomcat and postgresql are installed in the linux server. We deployed our war file in the linux server. Initially the application runs fine and as time passes by the application gets slower. We checked the resources at that time and found out that some time cpu usage becomes high and other resources are normal. Also sometime outgoing traffic exceed 8 Mbps . The form load and other process get slower. Once the tomcat is restarted, then everything comes to normal. Application again becomes faster. We are unable to find out the problem. Is there any tomcat setting that can make our application run faster. Cpu usage graph is shown below:.

Allow a web application to access files on a windows share

I'm trying to allow a web application running on Linux Ubuntu 10.04.4 and WildFly 9 to access files on a windows share using the JCIFS library ( https://jcifs.samba.org/ ). When testing Samba connections in isolation from the rest of our web application and not using WildFly everything seems to work ok.
The issue is if the connection fails when connecting from the WildFly container - the wildfly processing jumps to 100% CPU, and stays there. As of now this is 12 hours # 100% CPU on our test system - so it's not timing out, if indeed something should be.
Using JCIFS in isolation from our webapp and Wildfly the protocol, authentication and file not found exceptions are caught and logged and it does not cause the java process to consume loads of CPU like the other scenario.
If anyone has any advise regarding their own experience or approaches to troubleshooting I could take I would be very grateful.

How do I deploy my Java Application to Azure Cloud Service(not VM or App Service) using a WAR file?

I need to deploy my Java application on Azure Cloud Service. I don't want the extra overhead that comes with managing my own machines using Azure VM, which is an IaaS, nor do I want to use App Service, since the max cores per machine is 4- My application is very compute intensive and I would like to use at least 16 cores per instance, which Azure Cloud Services provides(D5v2 instances).
My build system is Maven and I would like to use something like Codeship to build my .war and deploy it to Azure Cloud services(rather than using the Azure Eclipse SDK to manually Publish to Azure Cloud Services). I've spent hours on the Azure documentation, but haven't found any way of doing this.(Azure App Service has a simple 'upload a war to deploy' model. I dont know why the same isn't there for cloud services: https://azure.microsoft.com/en-in/documentation/articles/web-sites-java-get-started/).
Remember that Cloud Services are the original deployment mechanism for Azure, dating back to 2010 (ok, 2009 if you want to count pre-production days). The .cspkg format is pretty much the same as it ever has been. The Web Apps deployment mechanism is completely different.
Eclipse (on Windows) has a specific plugin available for constructing .cspkg which you can then automate deploying, via PowerShell or CLI.
Alternatively, you can bundle your .war files within a .cspkg generated by Visual Studio, and then get things started within `OnStart(). Again, you can automate deployment from scripts - no need to ever publish directly from within an IDE.
Also: There's nothing stopping you from your automation process pushing .war files to blob storage (or somewhere else) and then sending your app some type of message letting it know to update itself. At that point, there's no redeployment of a .cspkg - rather, it's just downloading a new .war to running web/worker instances and restarting the java process.
#DylanColaco, As #DavidMakogon said, you can install the plugins named azure-tools-for-java for Eclipse or IntelliJ IDEA to deploy your war file as web/worker role instance into cloud service.
And there is an offical tutorial which shows how to getstarted.
As references, you can refer to the article lists and a very helpful vedio at Channel 9 below.
For Eclipse, https://azure.microsoft.com/en-us/documentation/articles/azure-toolkit-for-eclipse/
For IntelliJ, https://azure.microsoft.com/en-us/documentation/articles/azure-toolkit-for-intellij/
Java Applications in Windows Azure Cloud Services using Eclipse

Deployed WildFly WebSocket Giving poor Performance in Openshift . Need to restart the application in Openshift Site

Deployed WildFly Websocket application OPENSHIFT . Everything was going good . But Sometime Websocket is not working properly. Then again Everytime i am logging in Openshift Site and Restarting the application. After that it's working fine. After sometime again websocket is not working . Please help me to solve this. How to keep the application always live in OPENSHIFT ??
You might try checking for Memory Limit Violations (https://help.openshift.com/hc/en-us/articles/202399600-How-to-check-for-memory-limit-violations). If you are using small gears you might be running out of memory, your application may require a medium or large gear to work properly. Especially if you are running WildFly + a database on the same gear. Also keep in mind that the JVM is allocated 1/2 of the available gear memory by default, you can read more about that here (https://developers.openshift.com/en/wildfly-jvm-memory.html)

openshift, Tomcat 7 (JBoss EWS 2.0) and neo4j

I run a Java EE application on openshift with a Tomcat 7 server, and using neo4j in embedded mode for the persistance layer. I am using the openshift free plan for now. Every now and then, the application stops, and i get a 503 error. I suspect they pause the gear if the application is inactive for some time, but the application never restarts properly.
I have logged in using ssh and inspected the logs in Tomcat, but found no errors. I suspect that neo4j does not get to call shutdown, but i guess it should still recover.
Any ideas? What should i inspect?
It the application isn't receiving any external requests for 48 hours it will then get idled. However the application will automatically be restarted once an external request is made. Also since you're using java and your database on small gear, check to make sure you aren't hitting any memory limits (https://www.openshift.com/kb/kb-e1082-how-to-check-for-memory-limit-violations).

Categories

Resources