[pypy-dev] Does PyPy supports Java ME?
Jan Wedel
Jan.Wedel at ettex.de
Thu Oct 8 14:51:31 CEST 2009
> so far pypy-jvm doesn't use any of those, so it should not be a
problem.
> However, in the future reflection will be surely needed to access java
> libraries (but you don't seem to be interested in it) and class
loading for
> the jit.
Hmm, I'm not sure if one the goals for the future is still to use PyPy
for embedded target (as it was stated in one of these EU papers). But if
the answer is yes, you should really check embedded system constraits.
I think the idea of PyPy is really good because you can develop platform
independend application in Python and moreover auto-generate
interpreters for different software platforms while keeping the
interpreter code "synchronized" for all platforms. This is a really
good approach but you should consider the limitations of embedded
devices.
> I don't know for sure how to measure memory usage of java programs,
but if I
> just launch pypy-jvm and measure the amount of memory used on linux, I
get
> something like ~400 MB: this also includes the overhead of the jvm
itself, but
> it's still a lot.
I think for my task, PyPy is still too heavyweight although 400MB
includes paged memory and all loaded Java libraries so its REALLY not
possible to find out the real memory usage of a Java application (I
tried this on Linux before). So, I guess I will stick to the Java port
of PyMite/Python-on-a-chip.
But thank you for your help and good luck!
Jan
-----Ursprüngliche Nachricht-----
Von: Antonio Cuni [mailto:anto.cuni at gmail.com]
Gesendet: Donnerstag, 8. Oktober 2009 14:37
An: Jan Wedel; PyPy Dev
Betreff: Re: AW: Re: [pypy-dev] Does PyPy supports Java ME?
Jan Wedel wrote:
> Hi Anto!
>
> Thanks for your answer.
Hi Jan,
(I'm cc-ing pypy-dev again)
> Although it's now made by Sun, it shows the key points:
> - No class loading
> - No JNI
> - No reflection
>
> Which means you cannot load dynamic code during run-time. On top,
there
> are a lot of libraries missing (XML parsing, Regex, logging...)
so far pypy-jvm doesn't use any of those, so it should not be a problem.
However, in the future reflection will be surely needed to access java
libraries (but you don't seem to be interested in it) and class loading
for
the jit.
> THAT might be a problem since we are working on memory constrained
> systems with a maximum of a few MB of flash and approx. 200kB RAM. Are
> there any estimations about the RAM usage of PyPy using classes and
> other memory-consuming features?
I think that 200kB are definitely not enough for pypy-jvm.
I don't know for sure how to measure memory usage of java programs, but
if I
just launch pypy-jvm and measure the amount of memory used on linux, I
get
something like ~400 MB: this also includes the overhead of the jvm
itself, but
it's still a lot.
> And is this 8-10MB including only the core interpreter? Or are there
any
> ways to strip it down by excluding unnecessary libs?
it includes the core interpreter and the builtin modules; some of them
can be
stripped down, but I don't know how much you can save.
> I didn't make myself clear. I meant python libs/modules. E.g. sys,
> socket, sre etc... Because if these modules are supported I won't need
a
> lot of Java Libraries. As I explained, I already ported PyMite to Java
> and I discovered that numerous python modules have a C counterpart
such
> as _socket, _sre etc. So If you want to run these libs, you need to
> translate these C files.
ah, now I understand. This is the complete list of builtin modules that
are
enabled for pypy-jvm:
[translation] [usemodules]
[translation] __pypy__ = True
[translation] _ast = True
[translation] _codecs = True
[translation] _pickle_support = True
[translation] _random = True
[translation] _sre = True
[translation] _testing = True
[translation] _weakref = True
[translation] cStringIO = True
[translation] errno = True
[translation] gc = True
[translation] itertools = True
[translation] marshal = True
[translation] math = True
[translation] md5 = True
[translation] operator = True
[translation] parser = True
[translation] posix = True
[translation] rbench = True
[translation] sha = True
[translation] symbol = True
[translation] time = True
[translation] token = True
As you can see, _socket is missing. It's surely possible to write a
version of
it that works for the jvm, but as usual it takes some time and nobody
cared
enough to implement it.
ciao,
Anto
More information about the Pypy-dev
mailing list