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

... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
5513labe...6/11/20217245C# Winform 에서 Label에 동일한 Color를 넣었을 때 처리방법이 궁금합니다. [2]
55126/11/20218029xlwings 가 실행조차 되지 않습니다. ㅠㅠ [7]
5511Syong6/9/20216837User Control에 string array 속성 추가하는 방법 [4]
5510jay6/8/20215851string 문자열에 쌍따옴표(")를 넣고 싶습니다. [1]파일 다운로드1
5509한예지 donator6/3/20215800ExeccuteNonQuery 질문있습니다! [2]
5508최재남6/3/20216641마우스 이벤트 관련 질문 좀 드리겠습니다. [6]
5507한예6/2/20215819static과 스택오버플로우 질문있습니다. [5]파일 다운로드1
5506이창석6/1/20217232센서의 값을 받아서 PC를 통해 모니터링 하는 것을 만들고 있습니다. [1]
5505kss5/31/20215807.net5에서 소멸자가 어떻게 바뀐건가요? [1]
5503xing...5/24/20216176xingapinet 에 수정 요청 부탁 드립니다. [1]
5501한예지 donator5/23/20215948IProgress 사용법이 궁금합니다. [2]
5500한예ㅈ5/23/20217818비동기 코드 흐름 질문있습니다. [3]
5498곰장어5/21/20215680List에 static 변수를 추가했을때의 궁금증 [3]파일 다운로드1
5497지평선5/20/20216922윈도우 배율을 알 수 있을까요? [1]
5496cs린이5/20/20215555C# 8.0 질문입니다. [2]파일 다운로드6
5495Natie5/13/20215081객체를 생성과 동시에 초기화 하는 방법 [1]
5494지예예지5/13/20217357비동기 코드 흐름이 궁금합니다! [2]
5493xing...5/6/20215265xing api XQCSPAT00600 질문입니다 [4]파일 다운로드1
5492한예지 donator5/5/20215349FromCurrentSynchronizationContext 관련 코드 질문있습니다! [2]
5491조우성5/4/20219785WinForm과 WPF의 성능차이 비교한 자료가 있을까요? [4]
5490한예지 donator5/3/20216157UI 스레드의 Invoke 질문있습니다. [4]
5489저누4/28/20216750시작하세요 C# 9.0, 225페이지 구조체 관련 질문드립니다. [2]
5488종범4/27/20216998C# 비동기 함수 async, await 와 Task의 관계에 대해 질문 드립니다. [6]
5487진우4/27/20216354C# 엑셀 자동화 성능 향상 문의 [2]
5486지나가던...4/26/20215906닷넷 구현 코드 관련 질문 [2]
5485이재원4/17/20216276교재 315페이지 내용 질문 [3]
... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...