You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Herman Reintke <hr...@tauri.nl> on 2007/08/10 12:49:12 UTC

Building James, using wrapper

LS,

I am preparing a james 2.3.1 environment for upgrading from my 2.2.0 version.
For this I am installing a fresh, not updated 2.3.1 environment.

I downloaded the binary version, and was able to startup, both directly in a 
console and using the wrapper as a service.

The I took the source version (including avalon phoenix) and build it. 
No errors occured and the dist directory was created as expected.

This version I can start from the console and can install the wrapper version.
But when starting using : wrapper -s ..\conf\wrapper.conf from the bin
directory I get the following error : 

Attempting to start James Mail Server 2.3.0 as an NT service.
Calling StartServiceCtrlDispatcher...please wait.
StartServiceControlDispatcher failed!
For help, type
wrapper /?

Is there anything else I need to run, download or configure in order to be 
able to use the wrapper version ?

Kind regards,

Herman Reintke



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Building James, using wrapper

Posted by Herman Reintke <hr...@tauri.nl>.
Stefano Bagnara <apache <at> bago.org> writes:
 
> Herman Reintke ha scritto:
> > LS,
> > 
> > I am preparing a james 2.3.1 environment for upgrading from my 2.2.0 version.
> > For this I am installing a fresh, not updated 2.3.1 environment.
> > 
version.
> > But when starting using : wrapper -s ..\conf\wrapper.conf from the bin
> > directory I get the following error : 
> > 
> > Attempting to start James Mail Server 2.3.0 as an NT service.
> > Calling StartServiceCtrlDispatcher...please wait.
> > StartServiceControlDispatcher failed!
> > For help, type
> > wrapper /?
> 
> Have you followed the suggestion?
> I typed "wrapper /?" and it printed:
> -----------------
> Wrapper (Version 3.2.0) http://wrapper.tanukisoftware.org
> 
> Usage:
>   wrapper <command> <configuration file> [configuration properties] [...]
> 
> 
> As you can see "-s" is not a valid option.
> I just tried the -t, -p, -i, -r and all of them worked fine.
> 
> Stefano

Stefano,

Altough I did the same as you I probably had a situation of seeing 
instead of reading and did not notice that -s should be -t.
Everything works as expected.
Thanks for it.

Herman



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Out of memory error while fetch mail.

Posted by Stefano Bagnara <ap...@bago.org>.
Stefano Bagnara ha scritto:
> Try adding  -XX:+HeapDumpOnOutOfMemoryError to the java command
> launching james server.
> This way your JVM will write an heap dump at every OOM so we can see
> what objects are in memory when your server throws OOM.

I forgot to say that you need java6 to use that command. I hope you can
safely use a java6 jvm for the test.

Stefano



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Out of memory error while fetch mail.

Posted by Stefano Bagnara <ap...@bago.org>.
Fisher ha scritto:
> Hi,
> 
> I had finally got the problem, it is the InSpammerBlacklist matcher. After I
> commend this matcher, the problem goes away!
> I still very confusing with that issue yet. I saw a issue at James JIRA:
> InSpammerBlacklist latency seriously affects throughput(JAMES-758)
> 
> But it shows this only has performance issue, why could it cause JVM take so
> much memory? Further more I had try to use only one thread to run
> SpoolManager and sleep 5 second after it processed an email, and then the
> memory issue never happen. But even if I turn the sleep time to event 2
> Second, it will happen either, but need longer time to show up. Is this a
> bug with the DNS server?
> 
> Fisher

The only way we can tell is if you give us an heap dump.

Try adding  -XX:+HeapDumpOnOutOfMemoryError to the java command
launching james server.
This way your JVM will write an heap dump at every OOM so we can see
what objects are in memory when your server throws OOM.

This is a first step: if we can't find a solution this way then a real
memory profiler is needed.

Stefano



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Out of memory error while fetch mail.

Posted by Fisher <zo...@yinhoo.com>.
Hi,

I had finally got the problem, it is the InSpammerBlacklist matcher. After I
commend this matcher, the problem goes away!
I still very confusing with that issue yet. I saw a issue at James JIRA:
InSpammerBlacklist latency seriously affects throughput(JAMES-758)

But it shows this only has performance issue, why could it cause JVM take so
much memory? Further more I had try to use only one thread to run
SpoolManager and sleep 5 second after it processed an email, and then the
memory issue never happen. But even if I turn the sleep time to event 2
Second, it will happen either, but need longer time to show up. Is this a
bug with the DNS server?

Fisher

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Monday, August 13, 2007 4:35 PM
To: James Users List
Subject: Re: Out of memory error while fetch mail.

Fisher ha scritto:
> It seems not the JVM take the memory, but some other program does. But,
the
> TOP command shows it is the Java thread takes the memory. Is it a JVM bug?
> Or disk spool repository bug?

It is a JVM behavior. Free memory for the JVM is not free memory for the OS.

Your modern OS will take care to swap unused pages.

If you are interested in this topic here is a simple article:
http://benpryor.com/blog/index.php?/archives/15-JVM-vs-CLR-memory-allocation
.html

you can find many information googling for "JVM memory" "free" or
something similar in your preferred search engine.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Out of memory error while fetch mail.

Posted by Stefano Bagnara <ap...@bago.org>.
Fisher ha scritto:
> It seems not the JVM take the memory, but some other program does. But, the
> TOP command shows it is the Java thread takes the memory. Is it a JVM bug?
> Or disk spool repository bug?

It is a JVM behavior. Free memory for the JVM is not free memory for the OS.

Your modern OS will take care to swap unused pages.

If you are interested in this topic here is a simple article:
http://benpryor.com/blog/index.php?/archives/15-JVM-vs-CLR-memory-allocation.html

you can find many information googling for "JVM memory" "free" or
something similar in your preferred search engine.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: Out of memory error while fetch mail.

Posted by Fisher <zo...@yinhoo.com>.
Hi,

Thank you very much for Stefano's advice.  I follow the advice to change the
spool from disk spool to be JDBC spool then it works very well.
I still don' understand why disk spool will have problem. I had put hundreds
of emails to /var/mail/spool and close SMTP&FETCH MAIL. It will take all the
memory in a while, and NEVER release the memory even after the James had
processed all the emails in the spool. At that time, I login to the remote
manage UI, use memstat to see the JVM memory usage, the JVM still have
plenty memory. 
It seems not the JVM take the memory, but some other program does. But, the
TOP command shows it is the Java thread takes the memory. Is it a JVM bug?
Or disk spool repository bug?

Fisher

-----Original Message-----
From: Stefano Bagnara [mailto:apache@bago.org] 
Sent: Friday, August 10, 2007 9:27 PM
To: James Users List
Subject: Re: Out of memory error while fetch mail.

Fisher ha scritto:
> Hi,
> 
> I got a very strange problem. I running James on a server which have 4G
> memory total, and I allocated 768M memory to James. When I use fetch mail
to
> fetch email from remote server, the Java VM will take 95% memory (I saw
this
> with the TOP command), but while I login to RemoteConsole, use memstat to
> print the memory usage by James, it shows that only around 800M memory
> total, and around 500M free.
> Can someone tell me what happened? Thanks.
> 
> Fisher

This is standard behavior of memory allocation between JVM and the
undelying OS.

If at a given moment the JVM uses a lot of temporary objects (like
fetchmail does, as it creates many objects for every single incoming
mail) then it's up to the garbage collector to remove them from memory.
The garbage collector is only run at give times and if there is plenty
of memory available then this decrease the probability that the GC will
run and empty JVM memory. This means that the JVM will ask to the OS all
of the memory you assigned with the Xmx parameter.

The memory you see with MEMSTAT is the memory used by the JVM. Anyway,
once the JVM asked the max memory to the OS it won't be freed anymore.

The details depend on your OS, your kernel and you VM but most times the
sentence above is true.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Out of memory error while fetch mail.

Posted by Stefano Bagnara <ap...@bago.org>.
Fisher ha scritto:
> Hi,
> 
> I got a very strange problem. I running James on a server which have 4G
> memory total, and I allocated 768M memory to James. When I use fetch mail to
> fetch email from remote server, the Java VM will take 95% memory (I saw this
> with the TOP command), but while I login to RemoteConsole, use memstat to
> print the memory usage by James, it shows that only around 800M memory
> total, and around 500M free.
> Can someone tell me what happened? Thanks.
> 
> Fisher

This is standard behavior of memory allocation between JVM and the
undelying OS.

If at a given moment the JVM uses a lot of temporary objects (like
fetchmail does, as it creates many objects for every single incoming
mail) then it's up to the garbage collector to remove them from memory.
The garbage collector is only run at give times and if there is plenty
of memory available then this decrease the probability that the GC will
run and empty JVM memory. This means that the JVM will ask to the OS all
of the memory you assigned with the Xmx parameter.

The memory you see with MEMSTAT is the memory used by the JVM. Anyway,
once the JVM asked the max memory to the OS it won't be freed anymore.

The details depend on your OS, your kernel and you VM but most times the
sentence above is true.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Out of memory error while fetch mail.

Posted by Fisher <zo...@yinhoo.com>.
Hi,

I got a very strange problem. I running James on a server which have 4G
memory total, and I allocated 768M memory to James. When I use fetch mail to
fetch email from remote server, the Java VM will take 95% memory (I saw this
with the TOP command), but while I login to RemoteConsole, use memstat to
print the memory usage by James, it shows that only around 800M memory
total, and around 500M free.
Can someone tell me what happened? Thanks.

Fisher


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Building James, using wrapper

Posted by Stefano Bagnara <ap...@bago.org>.
Herman Reintke ha scritto:
> LS,
> 
> I am preparing a james 2.3.1 environment for upgrading from my 2.2.0 version.
> For this I am installing a fresh, not updated 2.3.1 environment.
> 
> I downloaded the binary version, and was able to startup, both directly in a 
> console and using the wrapper as a service.
> 
> The I took the source version (including avalon phoenix) and build it. 
> No errors occured and the dist directory was created as expected.
> 
> This version I can start from the console and can install the wrapper version.
> But when starting using : wrapper -s ..\conf\wrapper.conf from the bin
> directory I get the following error : 
> 
> Attempting to start James Mail Server 2.3.0 as an NT service.
> Calling StartServiceCtrlDispatcher...please wait.
> StartServiceControlDispatcher failed!
> For help, type
> wrapper /?

Have you followed the suggestion?
I typed "wrapper /?" and it printed:
-----------------
Wrapper (Version 3.2.0) http://wrapper.tanukisoftware.org

Usage:
  wrapper <command> <configuration file> [configuration properties] [...]

where <command> can be one of:
  -c   run as a Console application
  -t   starT an NT service
  -p   stoP a running NT service
  -i   Install as an NT service
  -r   Remove as an NT service
  -q   Query the current status of the service
  -qs  Silently Query the current status of the service
  -?   print this help message
------------

As you can see "-s" is not a valid option.
I just tried the -t, -p, -i, -r and all of them worked fine.

Stefano

> Is there anything else I need to run, download or configure in order to be 
> able to use the wrapper version ?
> 
> Kind regards,
> 
> Herman Reintke



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org