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

... 76  77  78  79  [80]  81  82  83  84  85  86  87  88  89  90  ...
NoWriterDateCnt.TitleFile(s)
499정성태10/30/200616648    답변글 [답변]: 질문 있습니다..ㅡ.ㅠ; [2]
495엔틱스10/25/200614259안녕하세요. 세션에 관련해서 질문을 올립니다. [2]
493안연준10/25/200614922스마트클라이언트 배포에서 Config 내용이 이해가 안되요
494안연준10/25/200613173    답변글 [답변]: 스마트클라이언트 배포에서 Config 내용이 이해가 안되요 [2]
489안연준10/23/200614422스마트 클라이언트 배포시 문제점
491안연준10/24/200615002    답변글 [답변]: 스마트 클라이언트 배포시 문제점 [2]
492안연준10/24/200614037        답변글 [답변]: [답변]: 스마트 클라이언트 배포시 문제점
488안연준10/23/200613806닷넷 프레임워크 때문에 일어난 어의없는 상황 [2]
484서민균10/20/200613856스마트 클라이언트 인쇄질문 올린 사람입니다.
486정성태10/22/200615156    답변글 [답변]: 스마트 클라이언트 인쇄질문 올린 사람입니다.
483guest10/19/200614257asp.net 에서 Com+ 등록된 dll 의 차이점이 무엇인지요?
485정성태10/22/200614982    답변글 [답변]: asp.net 에서 Com+ 등록된 dll 의 차이점이 무엇인지요?
490deve...10/23/200618279        답변글 [답변]: [답변]: asp.net 에서 Com+ 등록된 dll 의 차이점이 무엇인지요? [1]
478서민균10/17/200616195스마트 클라이언트로 만든 컴포넌트가 인쇄가 안되요.....ㅜㅜ [5]
477sagi...10/15/200615308bho 와 mfc 메시지 전송 관련 질문입니다.
479정성태10/17/200617074    답변글 [답변]: bho 와 mfc 메시지 전송 관련 질문입니다.
480sagi...10/17/200615053        답변글 [답변]: 감사합니다. [1]
481sagi...10/19/200614968            답변글 [답변]: 죄송합니다 .. 한가지 더 여쭤 볼께요
482정성태10/19/200614387                답변글 [답변]: [답변]: 죄송합니다 .. 한가지 더 여쭤 볼께요
496sagi...10/27/200615015                    답변글 [답변]: 감사드립니다.
476문태정10/11/200617406FarPointSpread로 출력 시 시트 암호설정문제 [1]
474임경훈10/9/200617740세션값이 유지가 안되는데요? [1]
470쿠리마9/29/200614233고수님들께 질문 올립니다. (C# COM Server에서 C++ Client에게 string맴버 포함한 구조체 배열 넘기기)파일 다운로드1
473정성태10/5/200616197    답변글 [답변]: 고수님들께 질문 올립니다. (C# COM Server에서 C++ Client에게 string맴버 포함한 구조체 배열 넘기기) [3]파일 다운로드1
469이방은9/29/200613956질문이 있어요.. [2]
466이승기9/25/200613754Attribute를 이용한 COM 구현 시 interface의 상속 [1]
... 76  77  78  79  [80]  81  82  83  84  85  86  87  88  89  90  ...