I have code that measure co2 from ccs811 sensor...
but the problem is that everytime that it measures, freeheap size is decresed and cause Exception(29)
Seeing as freeRTOS is a favorite of the Espressif, many calls are translated into freeRTOS macros. Example, using the delay() function in the Arduino Ide, is translated into vTaskDelay, a non CPU blocking delay. Note: Calling delay or other translated methods may cause freeRTOS to load, once freeRTOS is loaded your running in a multi-threaded environment.
I have found, for the ESP32 many Adafruit libraries are not really all that great at memory management.
I get better results when doing a search for a library for the ESP32 if I search on "esp32 ccs811". You might find doing a search on "esp8266 ccs811" would result in finding a working driver.