Microsoft MVP성태의 닷넷 이야기
Queue out of memory [링크 복사], [링크+제목 복사],
조회: 23499
글쓴 사람
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)
486정성태10/22/200615931    답변글 [답변]: 스마트 클라이언트 인쇄질문 올린 사람입니다.
483guest10/19/200615084asp.net 에서 Com+ 등록된 dll 의 차이점이 무엇인지요?
485정성태10/22/200615897    답변글 [답변]: asp.net 에서 Com+ 등록된 dll 의 차이점이 무엇인지요?
490deve...10/23/200619361        답변글 [답변]: [답변]: asp.net 에서 Com+ 등록된 dll 의 차이점이 무엇인지요? [1]
478서민균10/17/200617207스마트 클라이언트로 만든 컴포넌트가 인쇄가 안되요.....ㅜㅜ [5]
477sagi...10/15/200616179bho 와 mfc 메시지 전송 관련 질문입니다.
479정성태10/17/200617936    답변글 [답변]: bho 와 mfc 메시지 전송 관련 질문입니다.
480sagi...10/17/200615928        답변글 [답변]: 감사합니다. [1]
481sagi...10/19/200615833            답변글 [답변]: 죄송합니다 .. 한가지 더 여쭤 볼께요
482정성태10/19/200615159                답변글 [답변]: [답변]: 죄송합니다 .. 한가지 더 여쭤 볼께요
496sagi...10/27/200615812                    답변글 [답변]: 감사드립니다.
476문태정10/11/200618292FarPointSpread로 출력 시 시트 암호설정문제 [1]
474임경훈10/9/200618471세션값이 유지가 안되는데요? [1]
470쿠리마9/29/200615181고수님들께 질문 올립니다. (C# COM Server에서 C++ Client에게 string맴버 포함한 구조체 배열 넘기기)파일 다운로드1
473정성태10/5/200617016    답변글 [답변]: 고수님들께 질문 올립니다. (C# COM Server에서 C++ Client에게 string맴버 포함한 구조체 배열 넘기기) [3]파일 다운로드1
469이방은9/29/200614793질문이 있어요.. [2]
466이승기9/25/200614501Attribute를 이용한 COM 구현 시 interface의 상속 [1]
467이승기9/27/200614103    답변글 [답변]: Attribute를 이용한 COM 구현 시 interface의 상속
4659/23/200613645vb.net에서 c에서 보내는 Post메쎄지를 잡아서 처리할수 없을가요? [1]
464정윤수9/22/200615577asp.net 에서 DataSet 을 RecordSet 으로 변환 [2]
463sagi...9/22/200614384IE 제어 (BHO) 중 데이터 형에 질문 드립니다. [1]
462[손님]9/21/200616142ASP.NET 에서 COM+ 호출시 프로그램 구조를 어떻게 만들어야 할지...조언 부탁합니다. [2]파일 다운로드1
461정태운9/19/200616019Vista RC1에서 XPS Document를 Image로 변환하는 코드의 특정 API 가 동작하지 않습니다. [2]
459이방은9/14/200615064축하합니다.. [1]
458이승용9/7/200616496스마트 클라이언트 관련 질문입니다. [4]
456guest9/7/200616024데이타셋 암호화 방법...이 있을까요? [2]
... 76  77  78  79  [80]  81  82  83  84  85  86  87  88  89  90  ...