Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사],
조회: 24514
글쓴 사람
dev00
홈페이지
첨부 파일
 

안녕하세요^^

아래와 같은 상황에 대하여 궁금한점이 발생하여 질문드립니다.

제가 알기로는 QUEUE 에 크기는 무제한이라고 알고있는데 (제 컴퓨터 기준 중간에 OUT OF MEMORY가 뜹니다)

이유가 무엇인지 궁금합니다


추가1. 소스상의 for 구문중 i 가 134217728 일때 멈춥니다.
추가2. 혹시나하고 List<int>로해도 i가 134217728 일때 멈춥니다.

사용하고 있는 visualStudio는 2015 Commnuity 버전입니다.

---------소스코드----------------using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Queue<int> test1 = new Queue<int>();

            for(int i=0; i <1000000000; i++)
            {
                test1.Enqueue(i);
            }

            Console.Write("테스트");
        }
    }
}

----예외정보-------------------
System.OutOfMemoryException이(가) 처리되지 않았습니다.
  HResult=-2147024882
  Message='System.OutOfMemoryException' 형식의 예외가 Throw되었습니다.
  Source=System
  StackTrace:
       / System.Collections.Generic.Queue`1.SetCapacity(Int32 capacity)
       / System.Collections.Generic.Queue`1.Enqueue(T item)
       / ConsoleApplication1.Program.Main(String[] args) 파일 C:\Users\1234\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:줄 18
       / System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       / System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       / Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       / System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       / System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       / System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       / System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       / System.Threading.ThreadHelper.ThreadStart()
  InnerException:








[최초 등록일: ]
[최종 수정일: 9/17/2016]


비밀번호

댓글 작성자
 



2016-09-17 10시56분
StringBuilder 에서의 OutOfMemoryException 오류 원인 분석
; http://www.sysnet.pe.kr/2/0/1171

.NET 64비트 응용 프로그램에서 왜 (2GB) OutOfMemoryException 예외가 발생할까?
; http://www.sysnet.pe.kr/2/0/946
정성태
2016-09-17 11시43분
[dev00] 정성태//답변감사합니다. 그런데 왜 2GB 바이트가 아니라 128MB 에서 멈추는걸까요?
[guest]
2016-09-18 01시31분
128MB가 아닙니다. 다시 계산해 보세요.
정성태

... 61  62  63  64  65  [66]  67  68  69  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
958꼭지3/3/201121777Supporting compressed request in WCF 3.5 [5]
957임동찬2/21/201122211WCF channel faulted 관련 [2]
956윤용한2/18/201125803WaitHandle.WaitOne 과 Stopwatch에 관한 질문 [3]
955최광욱2/17/201122098TFS 에서 소스 영구 제거 방법 [1]
954한장우2/16/201119820atl activeX 질문이요~ [1]
952박용운2/16/201120806IE8.0에서 BHO [1]
953박용운2/16/201120606    답변글 [답변]: IE8.0에서 BHO
951임동찬2/11/201121154WCF Service Reference [1]
950이성환2/9/201122860Windows application 프로젝트를 참조 했을 때 생성되는 실행파일을 직접 실행 불가능하도록 하고 싶습니다. [6]파일 다운로드1
947김순조1/24/201121045.NET based Com에서 Native ActiveX로 이벤트 보내기?? [2]파일 다운로드1
943김기룡1/3/201124487닷넷 에러시 조치사항관련... [2]
942김기룡12/27/201019525Thread 안정성 관련 문의 드립니다. [2]
941최광욱12/20/201019342정성태님 올리신 글중에 [1]
940최광욱12/20/201021301Assembly Unloading 관련해서 [2]
939최광욱12/20/201019330IIS 로그 읽기 [1]
938날쌘돌이12/14/201021134자바로 asp.net 인증하기 [3]
935김기룡12/13/201031547c#에서 c++로 개발된 dll에 byte[] 전달 관련하여 문의 드립니다. [6]
934임동찬12/7/201018765System.Reflection.Assembly.GetTypes() 메서드에 대해 [1]
929김준호12/2/201018607안녕하세요 비주얼베이직 2005 닷넷 관련 문의입니다 [1]
928김준호11/30/201018962안녕하세요 비주얼베이직 2005 닷넷 관련 문의입니다 [1]파일 다운로드1
927임동찬11/30/201020769Windows\\Temp 폴더의 이름모를 .tmp 파일들에 대해서 [1]
926이승규11/26/201040766IP접속 시도시 ORA-12504 에러 [1]
925임동찬11/11/201018060다른 프로그램의 컨트롤 건드려보기_추가질문(2) [1]
924임동찬11/10/201018637다른 프로그램의 컨트롤 건드려보기_추가질문 [1]
923임동찬11/9/201021362다른 프로그램의 컨트롤 건드려보기 [1]
922박태근11/2/201020027html5의 shape파일 관련 [1]파일 다운로드1
... 61  62  63  64  65  [66]  67  68  69  70  71  72  73  74  75  ...