/usr/local/lib/ruby/1.8/xsd/charset.rb:159:in `=~' failed to allocate memory

5 views
Skip to first unread message

Nicholas

unread,
Sep 15, 2006, 4:19:54 PM9/15/06
to soap4r
Does anybody know how to get around this error?

Cheers,
Nicholas

/usr/local/lib/ruby/1.8/xsd/charset.rb:159:in `=~'
/usr/local/lib/ruby/1.8/xsd/charset.rb:159:in `is_utf8'
/usr/local/lib/ruby/1.8/xsd/charset.rb:175:in `is_ces'
/usr/local/lib/ruby/1.8/xsd/datatypes.rb:197:in `screen_data'
/usr/local/lib/ruby/1.8/xsd/datatypes.rb:140:in `set'
/usr/local/lib/ruby/1.8/soap/encodingstyle/aspDotNetHandler.rb:199:in
`decode_textbuf'
/usr/local/lib/ruby/1.8/soap/encodingstyle/aspDotNetHandler.rb:135:in
`decode_tag_end'
/usr/local/lib/ruby/1.8/soap/parser.rb:190:in `decode_tag_end'
/usr/local/lib/ruby/1.8/soap/parser.rb:151:in `end_element'
/usr/local/lib/ruby/1.8/xsd/xmlparser/parser.rb:75:in `end_element'
/usr/local/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:36:in `do_parse'
/usr/local/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `do_parse'
/usr/local/lib/ruby/1.8/soap/parser.rb:92:in `parse'
/usr/local/lib/ruby/1.8/soap/processor.rb:39:in `unmarshal'
/usr/local/lib/ruby/1.8/soap/rpc/proxy.rb:236:in `unmarshal'
/usr/local/lib/ruby/1.8/soap/rpc/proxy.rb:175:in `route'
/usr/local/lib/ruby/1.8/soap/rpc/proxy.rb:141:in `call'
/usr/local/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call'
/usr/local/lib/ruby/1.8/soap/rpc/driver.rb:232:in `Execute'

tpo

unread,
Sep 16, 2006, 2:23:29 AM9/16/06
to soap4r
Nicholas wrote:
> Re: /usr/local/lib/ruby/1.8/xsd/charset.rb:159:in `=~' failed to allocate memory
[...]

> Does anybody know how to get around this error?
> /usr/local/lib/ruby/1.8/soap/rpc/driver.rb:232:in `Execute'

The machine/ruby runs out of memory.

* maybe your machine doesn't have enough memory? Could this reasonably
be?
(run top in parallel to your program to see)
* or maybe there's a memory problem in soap4r. There have recently been
memory
utilization fixes in soap4r. Maybe you want to try a recent soap4r?

*t

Nicholas

unread,
Sep 18, 2006, 12:25:25 PM9/18/06
to soap4r
Thank you -- I will a more recent soap4r as the issue arises on the
same line everytime. I'm on a shared hosting environment running a
Rails app and need to include the path to the udpate version of soap4r
-- I'm doing this but it seems to be using the old version in
/usr/local/lib/ruby. Any ideas?

$:.unshift("#{RAILS_ROOT}/vendor/soap4r/lib")

Nicholas

unread,
Sep 18, 2006, 1:09:59 PM9/18/06
to soap4r
Ignore my last message, I had to put it in the Rails::Initializer.run
block.

Nicholas

unread,
Sep 18, 2006, 5:55:31 PM9/18/06
to soap4r
OK - updating the soap4r to the most recent release 20060830 hasn't
helped. I guess I have a memory leak somewhere as tpo suggested. I will
look into this tomorrow.

NAKAMURA, Hiroshi

unread,
Sep 24, 2006, 9:55:18 AM9/24/06
to soa...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Nicholas wrote:
> Does anybody know how to get around this error?

Hmm. Soap4r tries to check if a given byte sequence of string is UTF-8
encoded. Please ensure you give an UTF-8 encoded string.

Anyway, soap4r (+ ruby) should not consume much memory only for
validation. I'll drop the validation. (XML processor must check instead)

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRRaORh9L2jg5EEGlAQLiLwgAjpRevZPN7anPQjnvRUxWE9nW0eJ6hDTD
z7ljZXSBRbMV3StReFEOboPkbGfTifUr8jPKRButS35+B1LHnbxutLka9hlnrFIR
d5UsI4QzD7eykRQ0yLOYIpFmH7Ncglt/QLz+eFSMA4oE9ZuroKwkZUNgUTE8pfBH
lFIgFKOic5/+NwkdZ10qaZZkuCIojX/AwAzbpxFIy3zDUiqvmg38QXP+4A4DglPU
lGh+7nm1B4wG2LVMWfOaPh18+CW340XKkFMmRWp/qzSqnVa53BhVJRc0S2Rghvp9
iic4NboCQqjqCbjIC5eG4fYSkJZ+HVgbrXF06ZAUsjg3dtX4sc/cAw==
=1UX8
-----END PGP SIGNATURE-----

Nicholas

unread,
Sep 25, 2006, 4:29:36 PM9/25/06
to soap4r
OK, I was using XMLSimple to convert my reply from the webservice to a
Hash. That seemed to be a huge memory hog. I'm now using REXML and
streaming the XML. This is working a lot better. But I still having
memory problems somewhere.

I am using REXML also to build my XML requests. Should I encode the
whole XML string using my_xml.to_s.unpack('C*').pack('U*') to get
encode as UTF-8?

Thank you,
Nicholas

Nicholas

unread,
Sep 25, 2006, 4:30:56 PM9/25/06
to soap4r

Nicholas

unread,
Sep 25, 2006, 4:32:10 PM9/25/06
to soap4r

NAKAMURA, Hiroshi

unread,
Oct 2, 2006, 3:34:00 AM10/2/06
to soa...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Nicholas wrote:
> OK, I was using XMLSimple to convert my reply from the webservice to a
> Hash. That seemed to be a huge memory hog. I'm now using REXML and
> streaming the XML. This is working a lot better. But I still having
> memory problems somewhere.

Soap4r < 2006-07-22 consumed huge memory as the ticket
http://dev.ctor.org/soap4r/ticket/224. Is it related to your situation?

> I am using REXML also to build my XML requests. Should I encode the
> whole XML string using my_xml.to_s.unpack('C*').pack('U*') to get
> encode as UTF-8?

I disabled regex based CES checking recently. Would you please try the
repository?

When all of your string is iso-8859-1 encoded, add the following line
somewhere in startup code.

XSD::Charset.encoding = "X_ISO8859_1"

or, as you stated, convert it to UTF-8 before passing it to soap4r.

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRSDA5x9L2jg5EEGlAQLigggAjsWLr2x0ixj96OiRJ23Irw+ZWn9Pux2W
zrdww+OpISSGiSVf6YRThw2SyBXrMY3NkqT7pJ8F6p863KP5/R6uyt1xOLmzPk5R
pWOJEUfl89os/WM/l8vgFVWT0U4wMluIewEDrPhVwpuSZRrBsH8xJU+Sfbnh0eWy
ZgE34FcJJvONrrKrBSnNODdv1WMnaASl+N1eQDw2qQBTYaXZtXNthHp4orHmh6Ak
2s0RUyEJqXdXYrodzogDqrbKCMKhH/ZLD8bxNEmgoLg67iaWaoSc4H7UDpdHRL5S
Hhw1vUeAOlJFx5NJY7HKrJ5zRUL53pWTYZI7N+51NDxPdvaR3bByuQ==
=DNHf
-----END PGP SIGNATURE-----

Nicholas Henry

unread,
Oct 6, 2006, 11:53:14 AM10/6/06
to soa...@googlegroups.com
Thank you very much for checking this out, however I still have a
memory issue after using the new version. I'm going to investigate in
other areas of my rails app as it could be located somewhere else.
Possibly just running out of memory becauese of another issue, but
crashing at the same point.

Thanks again,
Nicholas

Reply all
Reply to author
Forward
0 new messages