Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory #16

Closed
LiTe1991 opened this issue Apr 16, 2018 · 1 comment
Closed

Out of memory #16

LiTe1991 opened this issue Apr 16, 2018 · 1 comment

Comments

@LiTe1991
Copy link

Hi,
I have a memory problem in my test application.
This application contains only the ice soap lib and the sense behind this application is, to load a zip over soap and save the zip into the cache. If I request the file over soap I got a out of memory exception during the parser.

at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~94) 04-16 15:06:12.121 699 724 I dalvikvm: at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:124) 04-16 15:06:12.121 699 724 I dalvikvm: at java.lang.StringBuilder.append(StringBuilder.java:271) 04-16 15:06:12.121 699 724 I dalvikvm: at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1338) 04-16 15:06:12.121 699 724 I dalvikvm: at org.kxml2.io.KXmlParser.next(KXmlParser.java:390) 04-16 15:06:12.121 699 724 I dalvikvm: at org.kxml2.io.KXmlParser.next(KXmlParser.java:310) 04-16 15:06:12.121 699 724 I dalvikvm: at com.alexgilleran.icesoap.parser.impl.XPathPullParserImpl.next(XPathPullParserImpl.java:90) 04-16 15:06:12.121 699 724 I dalvikvm: at com.alexgilleran.icesoap.parser.impl.BaseIceSoapParserImpl.parse(BaseIceSoapParserImpl.java:175) 04-16 15:06:12.121 699 724 I dalvikvm: at com.alexgilleran.icesoap.parser.impl.BaseIceSoapParserImpl.parse(BaseIceSoapParserImpl.java:127) 04-16 15:06:12.121 699 724 I dalvikvm: at com.alexgilleran.icesoap.parser.impl.BaseIceSoapParserImpl.parse(BaseIceSoapParserImpl.java:109) 04-16 15:06:12.121 699 724 I dalvikvm: at com.alexgilleran.icesoap.request.impl.RequestImpl.run(RequestImpl.java:333) 04-16 15:06:12.121 699 724 I dalvikvm: at com.alexgilleran.icesoap.request.impl.RequestImpl.executeBlocking(RequestImpl.java:227)

My application has only 128MB of memory, is there a way to load the data in a efficient way?

Best regards
LiTe

@AlexGilleran
Copy link
Owner

Probably not, it's a pretty unusual use of SOAP - if you're fitting the entire ZIP file into a SOAP envelope somehow (via base64 or something like that?) I can't think of a way you'd parse it without ending up with the entire thing in memory... I don't think even dropping back to the XmlPullParser would help you unless you split the file over multiple tags and cache them to the file system piece by piece.

It'd be best to not use SOAP for a zip file, failing that you might have to do the request and manually look for the start of the file in the InputStream as it comes in so you can start piping it to the file system. I can't think of a way to do this with IceSoap, it pretty much assumes everything in your envelope can fit in memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants