

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
4 messages in net.java.dev.jna.usersRe: AW: [jna-users] Getting big strin...| From | Sent On | Attachments |
|---|---|---|
| mark...@dlr.de | Mar 30, 2009 5:53 am | |
| Timothy Wall | Mar 30, 2009 6:05 am | |
| mark...@dlr.de | May 4, 2009 1:54 pm | .dat |
| Timothy Wall | May 4, 2009 2:30 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: AW: [jna-users] Getting big string from c-library | Actions... |
|---|---|---|
| From: | Timothy Wall (twal...@dev.java.net) | |
| Date: | May 4, 2009 2:30:08 pm | |
| List: | net.java.dev.jna.users | |
Check your VM's documentation for any potential limitations on the size of java.lang.String.
Note that you'll need at least twice as much storage, since while the Java String is created you'll have to have both the native and Java representations extant.
You might write up a simple test case which *only* allocates a large native string and provides it to Java via JNA, and see at what size it breaks (if at all). If you've done this, and it does not fail, then your problem is probably not memory allocation, and you'll have to examine what else your native code is doing and try to put that in the standalone test.
On May 4, 2009, at 4:55 PM, <mark...@dlr.de> <mark...@dlr.de> wrote:
We do nothing special. We have a special library to read and manipulate xml files, written in C. These library has a extert-to- string function. So, reading a 200MB xml file is no problem, but when we try to export the contents to a java string, then the whole jvm crashes.
Are there maybe any known limitations about this?
Thanks in advance Markus
-----Ursprüngliche Nachricht----- Von: Timothy Wall [mailto:twal...@dev.java.net] Gesendet: Mo 30.03.2009 15:05 An: use...@jna.dev.java.net Betreff: Re: [jna-users] Getting big string from c-library
You'll have to be a little more specific about what you're doing. Reading a file into a Java String is not an atomic operation where a single implementation is obvious to everyone.
There's no reason you can't allocate that much memory via JNA.
On Mar 30, 2009, at 8:53 AM, <mark...@dlr.de> <mark...@dlr.de> wrote:
Hello,
we try to use a c-library in our java code, but when we try to get a big string from the c-library to a java string, then our java code crashes when importing more than 80 MB to a java string. But reading a simple ascii file with 100 MB to a java string works fine and fast. Is there a limitation in JNA about this?
--------------------------------------------------------------------- To unsubscribe, e-mail: user...@jna.dev.java.net For additional commands, e-mail: user...@jna.dev.java.net
< winmail .dat
---------------------------------------------------------------------
To unsubscribe, e-mail: user...@jna.dev.java.net For additional commands, e-mail: user...@jna.dev.java.net








.dat