From owner-freebsd-java@FreeBSD.ORG Thu Jan 22 11:17:22 2015 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFA42D31 for ; Thu, 22 Jan 2015 11:17:22 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E47B1D4 for ; Thu, 22 Jan 2015 11:17:22 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id ge10so956384lab.10 for ; Thu, 22 Jan 2015 03:17:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=gOKoPh3DGKvN+ux+9H9GqBWdzsm5KMN/PSL7/Tc6EOE=; b=E/YRP4/kZLlZTc1PzA1bPDA1v/KeCgU2n5tZu1OBGr3v+y3+LIbFpwIWwZZ8ySArEs 06ffbO+SEEeiQ2anWQaNUb37eAQ6lIX4uJoUHwuT5nqvVqGCelA9pTVeBslRUABEVNu3 5zzciGFdR4u6hYR1aVR0lTzIa5yxUxtwNbNp6BDeamixbJb4RkRase21RpuhqKu3yJgx JBfxOSp5dHTR4tOzyGmTesGJnN5Hzx8moYbKfma8CK7oVNnt0oVbOD/4iU94Evy8M0Cc 71OknnYhUn+Oh442Ly1DtMk48rR+a/2XB8+uzMzBmn91vtmSKw3B7HM8nZFx2QazpNv1 +GZg== X-Received: by 10.152.28.37 with SMTP id y5mr830377lag.55.1421925440368; Thu, 22 Jan 2015 03:17:20 -0800 (PST) Received: from [192.168.0.77] (mircat.net. [81.9.105.50]) by mx.google.com with ESMTPSA id f4sm923636lam.30.2015.01.22.03.17.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 03:17:19 -0800 (PST) Message-ID: <54C0DC3F.3010802@gmail.com> Date: Thu, 22 Jan 2015 14:17:19 +0300 From: Dmitry Samersoff User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Matthias Apitz , freebsd-java@freebsd.org Subject: Re: executing Java written code from C pgm References: <20150122102614.GA2046@c720-r276659> In-Reply-To: <20150122102614.GA2046@c720-r276659> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 11:17:23 -0000 -----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-----