[JBossWS] - Re: Web method memory leak?
by PeterJ
If you set the min and max heap sizes to different values, then when the JVM requires more heap space it will get it from the os, after which the JVM rarely lets go of that memory, even if the space required for those objects (the byte array in this case) is cleaned up during a garbage collection. Thus the behavior you are seeing in task manager does not indicate a memory leak - it is just how Java works.
To determine if a memory leak was taking place you would have to monitor the objects in the heap, either by monitoring the garbage collector (this lets you know if there is a possible leak but not where), or by using a tool like VisualVM which lets you take and compare heap dumps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168220#4168220
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168220
16 years, 4 months
[JBossWS] - Web method memory leak?
by pophristov
Hello,
We have a web service for file upload/download. We are using a web method that returns a chunk of the file as a byte array for downloading. When the web service client downloads a large file the memory used by the java.exe (monitored using Windows Task Manager) swiftly increases and is never released. Eventually the used memory becomes so much that the whole computer performance decreases dramatically. Same happens if simply return a large byte array:
| @WebMethod
| public byte[] downloadChunk() {
| return new byte[524288];
| }
|
We are using JBoss 4.2.1 GA with JBossWS 2.0.1. Java 1.5.0_15. It is running on Windows Vista 32.
Any help on solving this will be greatly appreciated. Thank you in advance.
BP
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168218#4168218
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168218
16 years, 4 months
[JBossWS] - Trying to use jboss.xml instead of @WebContext
by karypid
Hello,
I'm trying to secure a web service with basic http authentication, but I want to keep all JBoss-specific configuration out of my code. Therefore, I need some pointers as to how to express the @WebContext annotation (used to specify BASIC http authentication) in the jboss.xml deployment descriptor.
In more detail:
I have my service implemented as a stateless session bean. I have found the following code works perfectly to require authorization, but uses JBoss-specific annotations (marked in bold font):
@Stateless
| @WebService@SecurityDomain("JBossWS")@RolesAllowed("someRole")@WebContext(authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)public class MyWSBean {
| //...
| }
|
I therefore remove the @SecurityDomain and @WebContext annotations and added a jboss.xml deployment descriptor as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <jboss> <security-domain>java:/jaas/JBossWS</security-domain> <enterprise-beans>
| <session>
| <ejb-name>MyWSBean</ejb-name>
| <port-component>
| <port-component-name>MyWSBean</port-component-name> <auth-method>BASIC</auth-method> </port-component>
| </session>
| </enterprise-beans>
| </jboss>
However, the configuration is not picked up for some reason. All attempts to access the web service fail due to an authorization failure. I can tell that the jboss.xml file is pared because if I mistype something (e.g. use <ejb-name>MyWSBeanWILLNOTMATCH</ejb-name>, or <security-domain>ThisDoesNotExist</security-domain>) then JBoss complains during deployment that the bean / realm does not exist.
Specifically, I verified that my jboss.xml works for replacing the @SecurityDomain annotation by leaving @WebContext in the code and specifying the domain with the <security-domain> tag in jboss.xml: this works.
Can anybody help me out with the proper deployment descriptor content for replacing the @WebContext?
P.S. No other deployment descriptors exists (no webservices.xml and the ejb-jar.xml is empty).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168135#4168135
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168135
16 years, 4 months