Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사],
조회: 23503
글쓴 사람
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)
407김용국6/21/200613178                답변글 [답변]: 다시한번 문의드립니다!
398김성호6/17/200613774IE프로그래밍 관련하여 질문이
400정성태6/19/200613543    답변글 [답변]: IE프로그래밍 관련하여 질문이 [5]
396guest6/13/200613333CallByName 을 어떻게 처리해야 할지 ....조언 부탁합니다.
397정성태6/15/200612852    답변글 [답변]: CallByName 을 어떻게 처리해야 할지 ....조언 부탁합니다.
399guest6/19/200612428        답변글 [답변]: [답변]: CallByName 을 어떻게 처리해야 할지 ....조언 부탁합니다.
392이상식6/9/200613271스마트클라이언트 실행환경 관련 질문입니다.
394정성태6/12/200613174    답변글 [답변]: 스마트클라이언트 실행 환경 관련 질문입니다.
395이상식6/12/200613481        답변글 [답변]: [답변]: 스마트클라이언트 실행환경 관련 질문입니다.
391심현철6/9/200613430Win32 platform과 .NET platform간의 성능이 어느정도 차이가 날까요?
393정성태6/12/200613174    답변글 [답변]: Win32 platform과 .NET platform간의 성능이 어느정도 차이가 날까요?
390이현행6/6/200613372정말 답답해서 그렇습니다. [1]
389임경훈6/2/200623243sql과 oracle 사용시 파라메타 차이점
387창민 6/1/200615172안녕하세요.문제가 걸렸는데 해결기미가 안보여서 답답해서.. 혹시 아시면 문제 채질이라도...파일 다운로드1
388정성태6/1/200614765    답변글 [답변]: 안녕하세요.문제가 걸렸는데 해결기미가 안보여서 답답해서.. 혹시 아시면 문제 채질이라도...
385오윤섭5/31/200612418SmartClient 동적호출
386정성태6/1/200612891    답변글 [답변]: SmartClient 동적 호출
380윤용한5/29/200612910ATL Event에서 스크립트가 값을 다시 돌려주는 방법은?파일 다운로드1
381윤용한5/29/200612607    답변글 [답변]: ATL Event에서 스크립트가 값을 다시 돌려주는 방법은?
382윤용한5/29/200613163        답변글 [답변]: [답변]: ATL Event에서 스크립트가 값을 다시 돌려주는 방법은?
383정성태5/30/200613520            답변글 [답변]: [답변]: [답변]: ATL Event에서 스크립트가 값을 다시 돌려주는 방법은?
378guest5/26/200612926managed 와 unmanaged 의 차이가 뭐져?
379정성태5/26/200613205    답변글 [답변]: managed 와 unmanaged 의 차이가 뭐져? [1]
384guest5/30/200612736        답변글 감사합니다.
376노기도5/16/200612957vb6의 GetObjectContext 를 2005에서는 어떻게 사용해야 하나요? [3]
375이덕희5/15/200615153SmartClient 강좌를 보고... 엑박이 나옵니다... [2]파일 다운로드1
... 76  77  78  79  80  81  82  [83]  84  85  86  87  88  89  90  ...