Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2015 14:17:19 +0300
From:      Dmitry Samersoff <dsamersoff@gmail.com>
To:        Matthias Apitz <guru@unixarea.de>, freebsd-java@freebsd.org
Subject:   Re: executing Java written code from C pgm
Message-ID:  <54C0DC3F.3010802@gmail.com>
In-Reply-To: <20150122102614.GA2046@c720-r276659>
References:  <20150122102614.GA2046@c720-r276659>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthias,

1. Regardless to number of running processes they all share the same
DSO so process size is not an issue.

But each java process require a Java and C heap, so if you plan to run
many processes in low-resource environment you should tune JVM options
to achieve better result.

2. You might consider to rewrite you business logic to spawn a new
java thread instead of new process.

- -Dmitry


On 2015-01-22 13:26, Matthias Apitz wrote:
> 
> Hello,
> 
> I have some C/C++ written servers and want to use code (classes)
> written in Java. I figured out how the load the JVM and to
> reference into the class as C function calls. I can post the
> details if someone is interested it this.
> 
> The problem is that the a.out must be linked against the JVM
> (libjvm.so) and the resulting process is around 300 MByte (text,
> data and bss), which makes it unusable in production (where some
> 200-300 processes of this are running).
> 
> Is there some way to compile the Java code to machine code with
> needing a JVM to execute this?
> 
> Thanks in advance
> 
> matthias
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUwNw/AAoJEHEy08c4gIABkt4H/iYhVQQzmIWnA4g6K5NEvubw
+BNYnaoNzRz2GHFT6q4H+EO3vamyDYxHSNKIsIkZoXbkcp8mAslujQtp+7Zo9vB7
rKU5/VlMqF1hPZW8q0KeTRZnm/WnYkuNIniDcc5ee5V6qvsDRK8i15QPG3zwB1BS
7J1wLf1Cr8v427dxzJYQ0az2T08nhufTjyfhHJ071RIW34qysWdpuKVS41GvBfS7
XDAVQIYaKHr3qLtA0finZ4MvAhy8gvRrYAxj9CRjBEgSw97JXM6csAFsN74rKj5d
kjgT60fAwdDUe6pFza6tK8MI/qHGR4k5Dfi5zQtZqGZbTZUw8QBFXL9ic60toB4=
=aNj6
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54C0DC3F.3010802>