Questions tagged [capacity]

Questions about resource capacity. Use in conjunction with the applicable tag such as [memory], [disk] or [database] to indicate the type of resource being referred to.

Questions about resource capacity. Use in conjunction with the applicable tag such as , or to indicate the type of resource being referred to.

250 questions
-1
votes
6 answers

What is the capacity of a StringBuffer ? And What is its purpose and its effect?

What is the capacity of a StringBuffer ? Is it necessary to set the size of the capacity when the program starts?And if not set,is cause the program to run slowly? eg. more than 1000 length character use StringBuffer outputSource = new…
wilson
  • 281
  • 6
  • 22
-2
votes
2 answers

non-Apple C compiler for mac

Looking for small C/C++ compiler available for OS X Catalina without the need of installing both xcode and command line tools. CLT itself takes over a Gig, xcode even more. Preferably around or below 100Mb if possible. Please kindly advice. P.S.…
user10522307
-2
votes
1 answer

Extend memory when grow slice (logic grow capacity underlying array)

I know (and read in internet - including this resource). That the logic for increasing memory is: if len array less than 1024 - golang multiply array on 2 else multiply len on 1.25 (and we see this in source code no question…
rtut
  • 303
  • 1
  • 3
  • 18
-2
votes
1 answer

"Safe" way to add an element to a std::vector beyond its size() but under its capacity()

It might sound dangerous, but I'm trying to do something like this: std::vector vElems; StructureSlowToBeCreated s1, s2; vElems.reserve(many_slots_for_structs); vElems[x1] = s1; // I can ensure x1, x2 <…
-3
votes
1 answer

How to lower Count without reducing Capacity in C# List

I have a list that should be completely removed once every frame on an interactive app. I reserved a capacity to 10.000 items at the beginning to avoid the overhead of adding items one by one. Then I want to remove all of them. Apparently using…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
-3
votes
2 answers

List.Capacity does not working

List.Capacity does not working Code var xx = new List(); xx.Add(1); int xxxx = xx.Capacity;// result is 4 and change to 8,12,16 while adding new item to xx list. But the capacity is does not working, which mean does not increasing…
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
-4
votes
4 answers

How can I expand List capacity in Python?

read = open('700kLine.txt') # use readline() to read the first line line = read.readline() aList = [] for line in read: try: num = int(line.strip()) aList.append(num) except: print ("Not a number in line " +…
Ali Kahya
  • 1
  • 1
  • 7
-4
votes
1 answer

StringBuffer capacity()

public static void main(String args[]){ StringBuilder sb=new StringBuilder(); System.out.println(sb.capacity()); sb.append("abcabcabcabcabcabcab"); System.out.println(sb.length()); System.out.println(sb.capacity()); …
Ruchi Gupta
  • 89
  • 1
  • 9
1 2 3
16
17