|
From: <php...@li...> - 2007-07-27 11:50:31
|
Hi Jost!
I got your message about sending you the debug log. I
was kind of tied up today (and maybe tomorrow).
Hopefully, I can send you the log by Monday at the
latest.
Btw, I forgot to tell you, I'm using an external
application (MediaWiki). This calls a PHP script that
calls Java code.
Here is a rough time profile:
1) MediaWiki loads a new article (no PHP script)
- 0 to 2 seconds
2) MediaWiki loads article that contains PHP script
that calls Java code using PHP-Java Bridge
a) For the first time - 12 to 18 seconds
b) Succeeding times - 1 to 4 seconds
(not 5 seconds as I reported to you last time)
Meantime, could you point me out to websites that
explain how Apache and PHP work together, and also the
Java VM, so I can better understanding of PHP-Java
Bridge?
Thanks!
Filip
Send instant messages to your online friends http://uk.messenger.yahoo.com
|
|
From: <php...@li...> - 2007-07-30 08:48:47
|
Hi again, Jost! Just so you know, I still haven't tried out your suggestion to save the log and send it to you. Off the top of my head, it might have to do with the fact that there is a third-party application (MediaWiki) taking up memory that slows down PHP-Java bridge code. I'll keep you posted. Filip Send instant messages to your online friends http://uk.messenger.yahoo.com |
|
From: <php...@li...> - 2007-07-30 08:50:39
|
Just a quick question -- you do recommend using java_reset() after our PHP script is done calling Java code, so as to release memory (for use by other processes)? Filip Send instant messages to your online friends http://uk.messenger.yahoo.com |
|
From: <php...@li...> - 2007-07-30 09:08:53
|
Hi Philip,
> Just a quick question -- you do recommend using
> java_reset() after our PHP script is done calling Java
> code, so as to release memory (for use by other
This is neither documented nor recommended. It is only used to create a clean environment
during the feature tests.
java_reset() already displays a warning message. I think we should throw an non-catchable error
in the next release if it is used outside of a test environment.
Regards,
Jost Boekemeier
Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
|
|
From: <php...@li...> - 2007-08-02 09:03:18
|
Hi Jost! As you suggested, I opened a ticket and appended the detailed PHP-Java Bridge log (level = 5) at the end of that ticket. I also included additional information (e.g. my environment and the way I use PHP-Java Bridge code) in there. http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233 I hope you can help me find out why my code executes very slowly, and get ideas on optimizing PHP-Java Bridge code usage. Thank you very much! Regards, Filip Send instant messages to your online friends http://uk.messenger.yahoo.com |
|
From: <php...@li...> - 2007-08-02 17:59:55
|
Hi,
the code pulls the java libraries from a remote server. Furthermore you remove all cached
libraries at the end of the script, probably to emulate the dynamic behaviour which is switched
off for remote URL's. Fetching jar files from a HTTP url is expensive, especially if
you don't allow the bridge to cache them.
Please do NOT use the following:
java_require("http://myServer.com/myJarFile1.jar;http://myServer.com/myJarFile2.jar;...");
... execute PHP code ...
@java_reset();
In the next version of the bridge I will remove java_reset() entirely and disallow remote
URL's[1].
Regards,
Jost Boekemeier
[1] Neither is documented, so this shouldn't be a problem for most users. :)
__________________________________
Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-08-03 05:55:30
|
Hi Jost!
> the code pulls the java libraries from a remote
> server... Fetching jar files from a HTTP url is
> expensive,especially if you don't allow the bridge
> to cache them.
Actually, the jar files are not in a remote server.
They are in my PC which I am using as both server and
client. For some reason, the simple syntax below
would not work:
java_require("myJarFile1.jar;myJarFile2.jar;...");
That is why I switched to using HTTP urls. Hmmm...
could it be (another) Java classpath problem? All the
jar files inside java_require() should be in my Java
classpath right?
>Furthermore you remove all cached libraries at the
>end of the script, probably to emulate the dynamic
>behaviour which is switched off for remote URL's.
I assume that is what java_reset() does(?). I think I
did this because sometimes my Wiki runs sluggishly
after I visit a page that invokes PHP-Java Bridge.
That is true, even if the next pages I view do not use
PHP-Java Bridge anymore.
Hmmm... okay, I'll try your suggestions and hope that
fixes the problem. I wonder where I got
java_reset()? Maybe, from an old local copy of some
website?
Regards,
Filip
Send instant messages to your online friends http://uk.messenger.yahoo.com
|
|
From: <php...@li...> - 2007-08-04 16:03:29
|
Hi Filip,
> Actually, the jar files are not in a remote server.
then it is better to use a local URL. For example:
$here=getcwd();
java_require("$here/jar1.jar;$here/jar2.jar;...");
> could it be (another) Java classpath problem? All the
I don't think so.
> jar files inside java_require() should be in my Java
> classpath right?
No. -- Forget about the java classpath, this is an insane concept.
Please use the jar repository or java_require() instead.
> I assume that is what java_reset() does(?).
Yes. It clears the loader cache, which means that the dynamic loader
must load the classes again and again.
> did this because sometimes my Wiki runs sluggishly
> after I visit a page that invokes PHP-Java Bridge.
> That is true, even if the next pages I view do not use
> PHP-Java Bridge anymore.
Interesting. Java runs as a separate process. The only common
resource used by both processes is memory. Or this is a placebo
effect.
> java_reset()? Maybe, from an old local copy of some
> website?
It was documented in java.c, which doesn't exist anymore. But AFAIK
the documentation contained a warning that java_reset() should never
be used in user scripts.
If you have still performance problems please open a new ticket and
add a
echo java("java.lang.System")->currentTimeMillis();
to the beginning and the end of the script.
Regards,
Jost Boekemeier
__________________________________
Alles was der Gesundheit und Entspannung dient. BE A BETTER MEDIZINMANN! www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-07-27 16:05:02
|
Hi Filip,
> - 0 to 2 seconds
> a) For the first time - 12 to 18 seconds
> b) Succeeding times - 1 to 4 seconds
> (not 5 seconds as I reported to you last time)
which statements are so slow? Is it possible to add
echo java("java.lang.System")->currentTimeMillis(); echo "<br>\n";
at the beginning and the end of the script?
Regards,
Jost Boekemeier
__________________________________ Wissenswertes für Bastler und Hobby Handwerker. BE A BETTER HEIMWERKER! www.yahoo.de/clever
|