Click here to Skip to main content
15,889,335 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: AJAX textchange event then click event Pin
Shog925-Oct-07 9:23
sitebuilderShog925-Oct-07 9:23 
GeneralRe: AJAX textchange event then click event Pin
CandyMe25-Oct-07 18:03
CandyMe25-Oct-07 18:03 
QuestionDisable CompareValidator [modified] Pin
CandyMe24-Oct-07 19:46
CandyMe24-Oct-07 19:46 
AnswerRe: Disable CompareValidator Pin
pmarfleet25-Oct-07 8:13
pmarfleet25-Oct-07 8:13 
GeneralRe: Disable CompareValidator Pin
CandyMe25-Oct-07 18:01
CandyMe25-Oct-07 18:01 
Questionbyte[] memory consumption excedded Pin
Navneet Hegde24-Oct-07 4:14
Navneet Hegde24-Oct-07 4:14 
AnswerRe: byte[] memory consumption excedded Pin
Guffa24-Oct-07 9:22
Guffa24-Oct-07 9:22 
GeneralRe: byte[] memory consumption excedded Pin
Navneet Hegde24-Oct-07 20:01
Navneet Hegde24-Oct-07 20:01 
Hi .,
Yea,

--The client sends the request as --
<br />
<br />
     byte[] Dataset2Byte;<br />
     Dataset2Byte = CompressDataSet(DSet);<br />
     MyService Service = new MyService.Service<br />
     Service.UpdateTableData(Dataset2Byte ,tablename)<br />
     //This is the Compression function used.<br />
<br />
public byte[] CompressDataSet(DataSet ds)<br />
        {<br />
            try<br />
            {<br />
                BinaryFormatter bnformat = new BinaryFormatter();<br />
                using (MemoryStream memstream = new MemoryStream())<br />
                {<br />
                    bnformat.Serialize(memstream, ds);<br />
                    byte[] bs = memstream.GetBuffer();<br />
<br />
                    MemoryStream output = new MemoryStream();<br />
                    GZipStream ZipIt = new GZipStream(output,  CompressionMode.Compress, true);<br />
<br />
                    ZipIt.Write(bs, 0, bs.Length);<br />
                    ZipIt.Close();<br />
<br />
                    return output.ToArray();<br />
                }<br />
            }<br />
            catch (ApplicationException ex)<br />
            {<br />
                MessageBox.Show(ex.Message);<br />
                return null;<br />
            }<br />
<br />
        }


--- This is at server side webservice -----

     <br />
    public bool UpdateTableData(byte[] byteSet, string TableName)<br />
      {<br />
         // here byte[] byteSet is decompressed to Dataset again<br />
      }<br />
<br />
    private DataSet Decompress(byte[] ds)<br />
    {<br />
        try<br />
        {<br />
            MemoryStream input = new MemoryStream();<br />
            input.Write(ds, 0, ds.Length);<br />
            input.Position = 0;<br />
<br />
            GZipStream Unzipit = new GZipStream(input, 0, true);<br />
            MemoryStream output = new MemoryStream();<br />
<br />
            byte[] bf = new Byte[4096]; { }<br />
            int read = 1;<br />
            read = Unzipit.Read(bf, 0, bf.Length);<br />
            while (read > 0)<br />
            {<br />
                output.Write(bf, 0, read);<br />
                read = Unzipit.Read(bf, 0, bf.Length);<br />
            }<br />
            Unzipit.Close();<br />
            byte[] result = output.ToArray();<br />
<br />
            BinaryFormatter bnformat = new BinaryFormatter();<br />
            using (MemoryStream mStream = new MemoryStream(result))<br />
            {<br />
                return (DataSet)bnformat.Deserialize(mStream);<br />
            }<br />
<br />
        }<br />
        catch (Exception ex)<br />
        {<br />
             throw ex;<br />
        }<br />
    }


This throws the Error : memory consumption excedded
and on server Application Event Log you read recycled mmemory consumption exceeded 60% (267MB of RAM)
Now if I write this byteset to File it is of size 6MB.

Respect

Navneet.H

Develop2Program & Program2Develop

GeneralRe: byte[] memory consumption excedded Pin
Guffa25-Oct-07 1:08
Guffa25-Oct-07 1:08 
GeneralRe: byte[] memory consumption excedded Pin
Navneet Hegde28-Oct-07 21:11
Navneet Hegde28-Oct-07 21:11 
Questionoverride css for select element Pin
amit4uall23-Oct-07 20:40
amit4uall23-Oct-07 20:40 
AnswerRe: override css for select element Pin
WoutL23-Oct-07 22:27
WoutL23-Oct-07 22:27 
GeneralRe: override css for select element Pin
amit4uall23-Oct-07 23:32
amit4uall23-Oct-07 23:32 
Questionrelated to the AJAX.. [modified] Pin
abhishek chouksey23-Oct-07 19:27
abhishek chouksey23-Oct-07 19:27 
AnswerRe: related to the AJAX.. Pin
Christian Graus23-Oct-07 23:04
protectorChristian Graus23-Oct-07 23:04 
QuestionPHP Pin
RaveRare23-Oct-07 19:12
RaveRare23-Oct-07 19:12 
AnswerRe: PHP Pin
Christian Graus23-Oct-07 23:06
protectorChristian Graus23-Oct-07 23:06 
QuestionRemove confirmation msg on window.close Pin
vanhawk23-Oct-07 17:00
vanhawk23-Oct-07 17:00 
AnswerRe: Remove confirmation msg on window.close Pin
WoutL23-Oct-07 22:28
WoutL23-Oct-07 22:28 
AnswerRe: Remove confirmation msg on window.close Pin
kubben24-Oct-07 1:50
kubben24-Oct-07 1:50 
Questionmouse hover popup Pin
Jason Weibel23-Oct-07 16:26
Jason Weibel23-Oct-07 16:26 
AnswerRe: mouse hover popup Pin
Duane in Japan23-Oct-07 18:00
Duane in Japan23-Oct-07 18:00 
GeneralRe: mouse hover popup Pin
Jason Weibel24-Oct-07 3:45
Jason Weibel24-Oct-07 3:45 
QuestionCan we convert ASP.Net Project to EXE File ? Pin
hifiger200423-Oct-07 15:33
hifiger200423-Oct-07 15:33 
AnswerRe: Can we convert ASP.Net Project to EXE File ? Pin
Christian Graus23-Oct-07 15:36
protectorChristian Graus23-Oct-07 15:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.