Re: classloader for components in META-INF/context.xml?

2017-03-18 Thread Olaf Kock
Am 18.03.2017 um 10:54 schrieb Mark Thomas:
> On 17/03/2017 20:21, Mike Wilson wrote:
>> I also ran into [1].
>>
>> Some Tomcat configuration with custom components (Valves, Managers etc) may
>> be done from a webapp's META-INF/context.xml. But currently if those classes
>> are your own custom implementations they will not be found if residing
>> inside the webapp's war (but are f ex found if placed in /lib).
>>
>> Would it make sense for Tomcat to use the webapp classloader for components
>> that are specified in META-INF/context.xml?
> Potentially. It needs some thought when running under a SecurityManager.
Mark,
you probably know better than me - is there any kind of security
assumption involved when referencing connection pools etc? The nice
thing about JNDI resources (etc) is that the application has no
knowledge of database credentials (unless tricking with reflection) -
but if it can inject its own classes this way, I'd not be sure any more.

Sure, this would be a server side attack, of a rogue web application.
Not sure if this thought is valid or not - I just wanted to raise the
issue so that it can be defeated or taken into account. Maybe this is
what you meant with "when running under a SecurityManager".

Olaf
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 8/Redhat Linux 6.6 /Kernal 2.6.32 - Memory Won't Release

2017-03-18 Thread Mark Eggers
Eric,

On 3/16/2017 8:01 PM, Eric Chua wrote:
> I am running tomcat 8.0.121.  When I start my tomcat, it seems to be
> eating up all the memory on my system.  I have 16 GB, and it keeps on
> going.  Then when I try to kill the process, it dies but 12 GB is
> still being used even though everything is turn off.  The only way to
> reclaim the memory is to reboot.  I am running on redhat 6.5 and
> can't figure out what could be causing this.  I run the tomcat as a
> local user, and I know there aren't any other processes running as
> the local user.  I am running a spring MVC 4/Java 8/ struts web
> application. I have two of them with the same issue.  Any help would
> be appreciated. When I try to view all the running processes I cannot
> see where most of the 12 gb are being used.   The system came up with
> 2.2 gb used and after I start one web application it goes to 14-15gb.
> The funny thing is that I can kill it to reclaim the memory. Only a
> reboot works.  I am running a VMware instance with vcenter version
> 6.5.  This does not happen with Java 7 with tomcat 7. Any help would
> be appreciate.

I don't see this with any of my systems running the following configuration:

OS: CentOS 6.8
kernel: 2.6.32-642.15.1.el6.x86_64
JRE:1.8.0_121-b13
Tomcat: 8.0.41.0 (from tomcat.apache.org)

I'm slated to update these systems to 8.0.42 once I complete my tests. I
don't anticipate any issues, but a process is only good if you follow it.

Some of my VM systems run on VMWare, and others run on Xen.

I also have a lot of systems running on AWS Elastic Beanstalk, but right
now those systems are stock AWS AMI images.

They're running AWS's repackaged Tomcat 8.0.41, and OpenJDK 1.8.0_121-b13.

I don't see any issues there as well. I run a lot of microservices on
t2.micro EC2 instances. t2.micro instances are very memory-constrained.
I would see a lot of EC2 churn if I had memory issues.

Please get some sar / top / vmstat information from your system
administrator and post it to the list.

Also, does your application make use of native libraries? If so, what
are they, and are they compatible with Java 8?

. . . just my two cents
/mde/







signature.asc
Description: OpenPGP digital signature


Re: classloader for components in META-INF/context.xml?

2017-03-18 Thread Mark Thomas
On 17/03/2017 20:21, Mike Wilson wrote:
> 
> I also ran into [1].
> 
> Some Tomcat configuration with custom components (Valves, Managers etc) may
> be done from a webapp's META-INF/context.xml. But currently if those classes
> are your own custom implementations they will not be found if residing
> inside the webapp's war (but are f ex found if placed in /lib).
> 
> Would it make sense for Tomcat to use the webapp classloader for components
> that are specified in META-INF/context.xml?

Potentially. It needs some thought when running under a SecurityManager.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 8/Redhat Linux 6.6 /Kernal 2.6.32 - Memory Won't Release

2017-03-18 Thread Eric Chua
 blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px 
#715FFA solid !important; padding-left:1ex !important; background-color:white 
!important; } Thanks for getting back to me. The Linux version is 6.8.  I am 
unable to reclaim the memory on the system without a reboot .  Though i kill my 
process, i dont see where the memory went.  When I run the application in 
windows I get no problems.  The only difference I can see are the parameters 
and jmx.  I will try to remove all the parameters and start from scratch.   

How do I get you raw data?  This is observe behavior using top and free.  I am 
working with our admin to determine a solution.  
Thanks

Sent from Yahoo Mail for iPhone


On Friday, March 17, 2017, 8:54 AM, Christopher Schultz 
 wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Eric,

On 3/16/17 11:01 PM, Eric Chua wrote:
> I am running tomcat 8.0.121.  When I start my tomcat, it seems to
> be eating up all the memory on my system.  I have 16 GB, and it
> keeps on going.

What are your memory-related parameters when you launch the JVM?

Note that Java *never* gives any memory back to the OS, even when the
heap-usage goes down. This is a Java thing, not a Tomcat thing.

> Then when I try to kill the process, it dies but 12 GB is still 
> being used even though everything is turn off.

That makes no sense at all. Please provide some evidence this is
happening.

> The only way to reclaim the memory is to reboot.

If this is true, then you have some kind of awful kernel bug.

> I am running on redhat 6.5 and can't figure out what could be 
> causing this.  I run the tomcat as a local user, and I know there 
> aren't any other processes running as the local user.  I am running
> a spring MVC 4/Java 8/ struts web application. I have two of them
> with the same issue.  Any help would be appreciated. When I try to
> view all the running processes I cannot see where most of the 12 gb
> are being used.  The system came up with 2.2 gb used and after I
> start one web application it goes to 14-15gb.

Ok.

> The funny thing is that I can kill it to reclaim the memory. Only
> a reboot works.

You mean you CAN'T kill in to reclaim memory, right?

> I am running a VMware instance with vcenter version 6.5.  This
> does not happen with Java 7 with tomcat 7. Any help would be
> appreciate.

Something tells me you are reading or interpreting something
incorrectly, here. Can you please share your raw data, and where you
got that raw data? Something like reports from free/ps/top/sar/etc.?

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYy+qWAAoJEBzwKT+lPKRYd38P/34EhmWZaueHBR2cLJeitXa9
SOd5pf1XrtgVyyx6FebFQkNlckzUVV3LCrPMkL+OudWjezqU0c7O/F1sRlVJk18V
A767jMpcSRI183QpDPBmbHKv6zsoVVibyXwMTbTDRAKzV+7JEGA4SrMEzEoyTcIv
gak5ctUvAH6t+jQrLiuVCCIpsKnvDwoYmsbDo0fXmZ+mQgIHYSr3D4UCCEPBtsar
o5uDJrwbGZRtKsHSvRoCxTGXlXIlD8SUE/+SlPsHo+R79AXN0cyI2GYSh8OfAW12
7gLzvrGpRzwyD34V/uFhoTugIx5OnNuN0Pw2jGBjrlRsDvBETiy/1CRKwMDe7u59
7ev9emoq5WpNRrDJuBN4MMzrFtBNOM/o04MPg5KVoM0clHyXOJrXbHJ1EkYWIkLr
fdHr9ejfS9mQhYSYKXXSbjEDGOGGLrLmPbUJ6gfAg5PqsyNTYTYW24+bvpt1MykZ
dkQXAB1CQ0YdNm6YIipYMD/d9kEYVpbXEKuVGT7QWTHRD3z/Pdcfp4hb05ckw0a3
UIa8Jk1yh8Z+f4pjAKFPi1VhhbaGU8VjGXKpdVcso/Ljohe/SzKs+IWuSJ/H97tE
VzEwgYaMEPdtfSnBG5Hf/6HtnME4TCXSBn8rBcGCgn4/rvUIMJZOlXePRT0BLBOt
/vhOk/rN/5h1XOrqVaqF
=hBJ4
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org