Re: out of memory..urgent...Solution

2013-09-13 Thread Greg Keogh
> > UTF8 is a variable-width encoding so if the buffer is >100kB and a valid > multi-byte UTF8 encoded character happens to fall across the boundary of > buffers in subsequent loop iterations you might get either an incorrect > decoding or an exception thrown. > Right, decoding the bytes in fixed

RE: out of memory..urgent...Solution

2013-09-13 Thread David Kean
.@ozdotnet.com<mailto:ozdotnet-boun...@ozdotnet.com> [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of David Kean Sent: Wednesday, 11 September 2013 2:20 AM To: ozDotNet Subject: RE: out of memory..urgent Memory isn't unlimited. Basically, when you convert from a byte array -> stri

Re: out of memory..urgent...Solution

2013-09-13 Thread Tony McGee
*Sent:* Wednesday, 11 September 2013 2:20 AM *To:* ozDotNet *Subject:* RE: out of memory..urgent Memory isn't unlimited. Basically, when you convert from a byte array -> string, you have two copies of the same data (one for the byte array and one for the string) in memory. What exa

RE: out of memory..urgent...Solution

2013-09-13 Thread anthonyatsmallbiz
Thanks Mike..will implement your advice..just being lazy From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of mike smith Sent: Friday, 13 September 2013 5:13 PM To: ozDotNet Subject: Re: out of memory..urgent...Solution Like this. http

RE: out of memory..urgent...Solution

2013-09-13 Thread anthonyatsmallbiz
otNet Subject: Re: out of memory..urgent...Solution I am surprised this solves your memory problem, as although the UTF8 GetString(Byte[]) defers to Encoding's base method, that returns the result of GetString(Byte[], int, int) which is overridden by UTF8, which calls String.CreateStringFromEncod

Re: out of memory..urgent...Solution

2013-09-13 Thread Mark Hurd
nd is intended only for use of the addressee. > If you are not the intended recipient, you are hereby notified that any > disclosure, reproduction, distribution or other use of this communication is > strictly prohibited. > If you have received this communication in error, please notify th

Re: out of memory..urgent...Solution

2013-09-13 Thread mike smith
@ozdotnet.com] *On Behalf Of *mike smith > *Sent:* Friday, 13 September 2013 4:50 PM > *To:* ozDotNet > *Subject:* Re: out of memory..urgent...Solution > > ** ** > > Are you doing something odd with generational garbage collection here? ** > ** > > ** ** >

RE: out of memory..urgent...Solution

2013-09-12 Thread anthonyatsmallbiz
...@ozdotnet.com] On Behalf Of mike smith Sent: Friday, 13 September 2013 4:50 PM To: ozDotNet Subject: Re: out of memory..urgent...Solution Are you doing something odd with generational garbage collection here? On Fri, Sep 13, 2013 at 2:46 PM, wrote: If you are interested..memeory issue was

Re: out of memory..urgent...Solution

2013-09-12 Thread mike smith
intended recipient, you are hereby notified that any > disclosure, reproduction, distribution or other use of this communication > is strictly prohibited. > If you have received this communication in error, please notify the sender > by reply transmission and delete the message without copying or disclosin

RE: out of memory..urgent...Solution

2013-09-12 Thread anthonyatsmallbiz
David Kean Sent: Wednesday, 11 September 2013 2:20 AM To: ozDotNet Subject: RE: out of memory..urgent Memory isn't unlimited. Basically, when you convert from a byte array -> string, you have two copies of the same data (one for the byte array and one for the string) in memory. What ex

RE: out of memory..urgent

2013-09-10 Thread David Kean
Memory isn't unlimited. Basically, when you convert from a byte array -> string, you have two copies of the same data (one for the byte array and one for the string) in memory. What exactly are you doing? You are typically better off chunking and reading smaller amounts of data at a time. Use s

RE: out of memory..urgent

2013-09-10 Thread anthonyatsmallbiz
Thanks people..going through all these options...let hope it fixes it...i'll keep you informed.. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Keogh Sent: Tuesday, 10 September 2013 2:48 PM To: ozDotNet Subject: Re: out of memory..urgent

Re: out of memory..urgent

2013-09-09 Thread Greg Keogh
This is the utf8 validation I was thinking of -- Greg http://msdn.microsoft.com/en-us/library/302sbf78.aspx On 10 September 2013 14:00, wrote: > Not sure if it’s of use in this case but you can use > char.GetUnicodeCategory to check validity of a Unicode character > > > var validCharacter = 'q

Re: out of memory..urgent

2013-09-09 Thread osjasonroberts
Not sure if it’s of use in this case but you can use char.GetUnicodeCategory to check validity of a Unicode character varvalidCharacter='q'; varucCategory=char.GetUnicodeCategory(validCharacter); varisValidUnicode=ucCategory!=UnicodeCategory.OtherNotAssigned; varinvalidCharacter=(char) 8

Re: out of memory..urgent

2013-09-09 Thread Greg Keogh
Does the byte[] actually represent a valid utf-8 string? There are ways of validating, but I can't remember off the top of my head. You can also code Encoding.UTF8.Getstring() as there is a static member for convenience -- Greg On 10 September 2013 13:04, wrote: > Getting out of memory exceptio

Re: out of memory..urgent

2013-09-09 Thread Shane Nall
You should consider working with streams and a fixed buffer size rather than the encoding the whole thing at once. Cheers, Shane On 10/09/2013, at 1:04 PM, wrote: > Getting out of memory exception when I try to > > Dim s as string > Dim b() as Byte > > s=System.Text.Encoding.GetEnco