Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사],
조회: 13562
글쓴 사람
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가 아닙니다. 다시 계산해 보세요.
정성태

... 46  47  48  49  50  51  52  53  54  55  56  [57]  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
1208박지호2/9/201417171[오타] 시작하세요 C# 프로그래밍 p.267 ~ 350 [1]
1207임동찬2/5/201411604Web페이지에서 .net application 실행시키는 방법 [3]
1206신지환2/3/201413513visual sourcesafe(internet) 체크인 에러 [1]
1205박지호2/2/201415021[오타] 시작하세요 C# 프로그래밍 p.199 ~ 202 [1]
1204김태훈1/27/201426473Windows Service 오류 문의입니다. [2]
1203박지호1/26/201416697[오타] 시작하세요 C# 프로그래밍 p.131, 157, 180 [1]
1202이창주1/24/201418181[질문] Windows Error Reporting [8]
1201김나리1/21/201411473[시작하세요 C# 프로그래밍] 비동기 호출 [1]
1200박지호1/19/201416193[오타] 시작하세요 C# 프로그래밍 p.76 [1]
1199윤종현1/9/201412119p654 의 비동기 관련 설명 [3]
1198초이1/4/201412389웹서비스 WSDL 생성및 프록시 클래스 생성 관련 질문입니다. [1]
1196박현수1/2/201411344[WCF] Client 호출 방법 [2]
1195박현수12/23/201311347[WCF] 클라이언트의 호출실패(IIS이용) [4]파일 다운로드1
1191박주만12/18/201318280C++ Dll 에서 C# 의 PictureBox이미지 변경문제 [1]
1193박주만12/19/201312493    답변글 [답변]: C++ Dll 에서 C# 의 PictureBox이미지 변경문제 [2]파일 다운로드1
1190정진호12/10/201310502비동기로 실행할수 있도록 Custom Attribute 를 만들고 싶습니다. [1]
1189Youn...12/10/201311031책을 사기전에 궁금한것이 있습니다. [1]
1188이민석12/5/201312137ocx 를 C#에서 마샬링관련 질문입니다.. [2]파일 다운로드1
1187이성환12/3/201313380WPF WebBrowser control의 자식 창이 close 되기 전 Navgate 재호출 문제 [2]파일 다운로드1
1186박종혁12/2/201311209책의 예제 중에 result 변수가 할당 되었지만 사용되지 않았다고 오류가 납니다!! [1]
1185박은희11/27/201314295멀티바이트로 개발한 프로그램을 유니코드로 변경시 쉽게 처리 하는법 [2]파일 다운로드1
1183박현수11/20/201311496WCF에서 web.config appsetting 읽기 [1]
1184박현수11/20/201311764    답변글 [답변]: WCF에서 web.config appsetting 읽기 [3]파일 다운로드1
1182유창우11/16/201320834자마린이 궁금... [8]
1181허관11/11/201310566책 샀습니다! [1]
1180김형지11/6/201314625안녕하십니까. 프로그램이 실행되지 않아 여쭙고자 합니다ㅠ [1]파일 다운로드1
... 46  47  48  49  50  51  52  53  54  55  56  [57]  58  59  60  ...